File tree Expand file tree Collapse file tree 2 files changed +51
-4
lines changed Expand file tree Collapse file tree 2 files changed +51
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Validate OpenAPI Check Docker
2+
3+ # **What it does**: Tests building and running the OpenAPI check Docker container
4+ # **Why we have it**: To ensure the Dockerfile and openapi-check script work correctly
5+ # **Who does it impact**: Docs engineering.
6+
7+ on :
8+ workflow_dispatch :
9+ pull_request :
10+ paths :
11+ - ' Dockerfile.openapi_decorator'
12+ - ' src/rest/scripts/openapi-check.ts'
13+ - ' src/rest/scripts/utils/get-operations.ts'
14+ - ' src/rest/scripts/utils/operation.ts'
15+ # In case dependencies change
16+ - ' package.json'
17+ - ' package-lock.json'
18+ - ' tsconfig.json'
19+ # Self-test
20+ - ' .github/workflows/validate-openapi-check.yml'
21+
22+ permissions :
23+ contents : read
24+
25+ jobs :
26+ validate-openapi-check :
27+ runs-on : ubuntu-latest
28+ if : github.repository == 'github/docs-internal'
29+ steps :
30+ - name : Checkout
31+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32+
33+ - name : Set up Docker Buildx
34+ uses : docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
35+
36+ - name : Build Docker image
37+ run : |
38+ docker build -f Dockerfile.openapi_decorator -t openapi-decorator:test .
39+
40+ - name : Test Docker image with sample OpenAPI file
41+ run : |
42+ docker run --rm openapi-decorator:test -f "src/rest/data/fpt-2022-11-28/schema.json"
43+
44+ - name : Test Docker image with multiple OpenAPI files
45+ run : |
46+ docker run --rm openapi-decorator:test \
47+ -f "src/rest/data/fpt-2022-11-28/schema.json" \
48+ "src/rest/data/ghec-2022-11-28/schema.json"
Original file line number Diff line number Diff line change 1- FROM node:18.15-alpine
2-
3- RUN apk add --no-cache git python make g++
1+ FROM node:24-alpine
42
53WORKDIR /openapi-check
64
@@ -10,10 +8,11 @@ USER node
108
119COPY --chown=node:node package.json /openapi-check
1210COPY --chown=node:node package-lock.json /openapi-check
11+ COPY --chown=node:node tsconfig.json /openapi-check
1312ADD --chown=node:node src /openapi-check/src
1413ADD --chown=node:node content /openapi-check/content
1514ADD --chown=node:node data /openapi-check/data
1615
1716RUN npm ci -D
1817
19- ENTRYPOINT ["node ", "/openapi-check/src/rest/scripts/openapi-check.ts"]
18+ ENTRYPOINT ["npx", "tsx ", "/openapi-check/src/rest/scripts/openapi-check.ts"]
You can’t perform that action at this time.
0 commit comments