diff --git a/.github/workflows/golang-test-linux.yml b/.github/workflows/golang-test-linux.yml index cf061f876..e727aa4e5 100644 --- a/.github/workflows/golang-test-linux.yml +++ b/.github/workflows/golang-test-linux.yml @@ -314,6 +314,7 @@ jobs: run: | CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \ NETBIRD_STORE_ENGINE=${{ matrix.store }} \ + CI=true \ go test -tags=devcert \ -exec "sudo --preserve-env=CI,NETBIRD_STORE_ENGINE" \ -timeout 20m ./management/... @@ -380,7 +381,8 @@ jobs: - name: Test run: | CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \ - NETBIRD_STORE_ENGINE=${{ matrix.store }} CI=true \ + NETBIRD_STORE_ENGINE=${{ matrix.store }} \ + CI=true \ go test -tags devcert -run=^$ -bench=. \ -exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE' \ -timeout 20m ./... @@ -396,6 +398,33 @@ jobs: store: [ 'sqlite', 'postgres' ] runs-on: ubuntu-22.04 steps: + - name: Create Docker network + run: docker network create promnet + + - name: Start Prometheus Pushgateway + run: docker run -d --name pushgateway --network promnet -p 9091:9091 prom/pushgateway + + - name: Start Prometheus (for Pushgateway forwarding) + run: | + echo ' + global: + scrape_interval: 15s + scrape_configs: + - job_name: "pushgateway" + static_configs: + - targets: ["pushgateway:9091"] + remote_write: + - url: ${{ secrets.GRAFANA_URL }} + basic_auth: + username: ${{ secrets.GRAFANA_USER }} + password: ${{ secrets.GRAFANA_API_KEY }} + ' > prometheus.yml + + docker run -d --name prometheus --network promnet \ + -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml \ + -p 9090:9090 \ + prom/prometheus + - name: Install Go uses: actions/setup-go@v5 with: @@ -447,11 +476,13 @@ jobs: - name: Test run: | CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \ - NETBIRD_STORE_ENGINE=${{ matrix.store }} CI=true \ + NETBIRD_STORE_ENGINE=${{ matrix.store }} \ + CI=true \ + GIT_BRANCH=${{ github.ref_name }} \ go test -tags=benchmark \ -run=^$ \ -bench=. \ - -exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE' \ + -exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE,GIT_BRANCH,GITHUB_RUN_ID' \ -timeout 20m ./management/... api_integration_test: @@ -505,7 +536,8 @@ jobs: - name: Test run: | CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \ - NETBIRD_STORE_ENGINE=${{ matrix.store }} CI=true \ + NETBIRD_STORE_ENGINE=${{ matrix.store }} \ + CI=true \ go test -tags=integration \ -exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE' \ -timeout 20m ./management/... diff --git a/README.md b/README.md index 4ab9db03b..e0f2df848 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ |----|----|----|----|----| | | | | | | | |