Skip to content

Commit 584ff89

Browse files
fredbiclaude
andcommitted
ci: add unsafe-skipauth tagged-build workflow with coverage
The new SetSkipAuth bypass lives behind the openapi_unsafe_skipauth build tag; the existing shared go-test workflow has no hook for matrix-wide build tags, so the tagged path would otherwise rot silently. Add a dedicated workflow that runs the middleware tests under the tag on stable + oldstable Go, uploads per-matrix coverage artifacts, and chains the standard collect-coverage shared job to push them to codecov. Modeled after go-openapi/strfmt's integration-test.yml; follows the runtime workflow conventions (pinned SHAs, blank-line step style, minimal workflow-level permissions, spaced expressions). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 4042690 commit 584ff89

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

‎.codecov.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
codecov:
2+
notify:
3+
after_n_builds: 2
4+
5+
coverage:
6+
status:
7+
patch:
8+
default:
9+
target: 80%
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: unsafe-skipauth test
2+
3+
permissions:
4+
pull-requests: read
5+
contents: read
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
12+
pull_request:
13+
14+
jobs:
15+
unsafe-skipauth-test:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
go-version: [stable, oldstable]
21+
22+
steps:
23+
-
24+
name: Checkout
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
-
27+
name: Setup Go
28+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
29+
with:
30+
go-version: ${{ matrix.go-version }}
31+
-
32+
name: Test the dev-mode SetSkipAuth path
33+
run: >
34+
go test -tags openapi_unsafe_skipauth -race -count=1
35+
-coverprofile='skipauth.coverage.ubuntu-latest-${{ matrix.go-version }}.out'
36+
-covermode=atomic
37+
-coverpkg='github.com/go-openapi/runtime/middleware'
38+
./middleware/...
39+
-
40+
name: Upload coverage artifacts
41+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
42+
with:
43+
path: 'skipauth.coverage.ubuntu-latest-${{ matrix.go-version }}.out'
44+
name: 'skipauth.coverage.ubuntu-latest-${{ matrix.go-version }}'
45+
retention-days: 1
46+
47+
collect-coverage:
48+
needs: [unsafe-skipauth-test]
49+
if: ${{ !cancelled() && needs.unsafe-skipauth-test.result == 'success' }}
50+
uses: go-openapi/ci-workflows/.github/workflows/collect-coverage.yml@7982843ba86a9b47f456a44ed94e82f882b50a8d # v0.2.17
51+
secrets: inherit

0 commit comments

Comments
 (0)