BREAKING CHANGE: Die alte Shell-Version muss vor der Installation der Go-Version deinstalliert werden.
47 lines
1.0 KiB
YAML
47 lines
1.0 KiB
YAML
# AdGuard Shield CI - Pull Request Tests
|
|
# Runs on every PR to master: format check, vet, build and tests.
|
|
name: PR Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [master]
|
|
workflow_dispatch:
|
|
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
test:
|
|
name: Format, Vet, Build & Test
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: golang:1.26.2-alpine
|
|
|
|
steps:
|
|
- name: Install build dependencies
|
|
run: apk add --no-cache git nodejs
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Go module cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: /go/pkg/mod
|
|
key: go-mod-${{ hashFiles('go.sum') }}
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Check formatting
|
|
run: |
|
|
test -z "$(gofmt -l .)"
|
|
|
|
- name: Go vet
|
|
run: go vet ./...
|
|
|
|
- name: Build Linux binary
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -o /tmp/adguard-shield ./cmd/adguard-shieldd
|
|
|
|
- name: Run tests
|
|
run: go test ./... -v -count=1 -timeout 120s
|