Skip to content

Add pipeline queue monitoring with Prometheus metrics #1255

Add pipeline queue monitoring with Prometheus metrics

Add pipeline queue monitoring with Prometheus metrics #1255

Workflow file for this run

name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Build
run: go build -v ./...
- name: Make coverage dirs
run: mkdir -p /tmp/unit_coverage /tmp/e2e_coverage
- name: Disable AppArmor unprivileged user namespaces limitations
# https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Test
run: go test -v -p=12 -race -cover -covermode=atomic -coverpkg=./... $(go list ./... | grep -v /e2e/test/) -args -test.gocoverdir=/tmp/unit_coverage
- name: E2E Test
run: go test -v -p=12 -race -cover -covermode=atomic -coverpkg=./... $(go list ./e2e/test/...) -args -test.gocoverdir=/tmp/e2e_coverage
- name: Convert coverage reports
run: |
go tool covdata textfmt -i /tmp/unit_coverage/ -o unit_coverage.txt
go tool covdata textfmt -i /tmp/e2e_coverage/ -o e2e_coverage.txt
- name: Upload coverage reports to Codecov (unittests)
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 #v5.5.1
continue-on-error: true
with:
flags: unittests
files: ./unit_coverage.txt
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov (e2e tests)
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 #v5.5.1
continue-on-error: true
with:
flags: e2etests
files: ./e2e_coverage.txt
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Goroutine leak detector
run: go test -c -o tests && for test in $(go test -list . | grep -E "^(Test|Example)"); do ./tests -test.run "^$test\$" &>/dev/null && echo -e "$test passed\n" || echo -e "$test failed\n"; done
cross-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5
- name: Build for Windows
run: CC="zig cc -lc -target x86_64-windows" CXX="zig c++ -lc -target x86_64-windows" CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -v ./...
- name: Build for linux/arm64
run: CGO_ENABLED=1 CC="zig cc -lc -target aarch64-linux-musl" CXX="zig c++ -lc -target aarch64-linux-musl" GOOS=linux GOARCH=arm64 go build -v ./...