@@ -3,39 +3,74 @@ name: Check OpenAPI specs
33on :
44 push :
55
6- # env:
7- # APIFY_STAGING_TOKEN: ${{ secrets.APIFY_STAGING_TOKEN }}
8-
96jobs :
107 build :
118 name : Build the specification file
129 runs-on : ubuntu-latest
1310
1411 steps :
15- - uses : actions/checkout@v5
16-
17- - name : Use Node.js 22
18- uses : actions/setup-node@v6
19- with :
20- node-version : 22
21- cache : ' npm'
22- cache-dependency-path : ' package-lock.json'
23-
24- - name : Enable corepack
25- run : |
26- corepack enable
27-
28- - name : Install Dependencies
29- run : npm ci --force
30- env :
31- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
32-
33- - run : |
34- npm ci
35- npm run redoc:test
36-
37- # TODO
38- # - uses: actions/setup-python@v5
39- # with:
40- # python-version: '3.10'
41- # - run: python -m pip install schemathesis==3.35.0
12+ - uses : actions/checkout@v6
13+
14+ - name : Use Node.js 24
15+ uses : actions/setup-node@v6
16+ with :
17+ node-version : 24
18+ cache : " npm"
19+ cache-dependency-path : " package-lock.json"
20+
21+ - name : Enable corepack
22+ run : |
23+ corepack enable
24+
25+ - name : Install Dependencies
26+ run : npm ci --force
27+ env :
28+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
29+
30+ - run : |
31+ npm run redoc:test
32+
33+ validate-go-codegen :
34+ name : Validate Go client generation
35+ runs-on : ubuntu-latest
36+
37+ steps :
38+ - uses : actions/checkout@v6
39+
40+ - name : Use Node.js 24
41+ uses : actions/setup-node@v6
42+ with :
43+ node-version : 24
44+ cache : " npm"
45+ cache-dependency-path : " package-lock.json"
46+
47+ - name : Enable corepack
48+ run : |
49+ corepack enable
50+
51+ - name : Install Dependencies
52+ run : npm ci --force
53+
54+ - name : Build OpenAPI spec
55+ run : npm run redoc:build:clean:yaml
56+
57+ - name : Setup Go
58+ uses : actions/setup-go@v6
59+ with :
60+ go-version : " 1.25"
61+ # Disable caching since go.sum is gitignored and regenerated on each run.
62+ cache : false
63+
64+ - name : Install oapi-codegen as tool
65+ working-directory : codegen/oapi-codegen-go
66+ run : go get -tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
67+
68+ - name : Generate Go client
69+ working-directory : codegen/oapi-codegen-go
70+ run : go tool oapi-codegen -config oapi-codegen.yaml ../../static/api/openapi.yaml
71+
72+ - name : Build generated client
73+ working-directory : codegen/oapi-codegen-go
74+ run : |
75+ go mod tidy
76+ go build ./...
0 commit comments