up
This commit is contained in:
56
.gitea/workflows/oas-ci.yml
Normal file
56
.gitea/workflows/oas-ci.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
name: oas-ci
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "src/Api/**"
|
||||
- "scripts/api-*.mjs"
|
||||
- "package.json"
|
||||
- "package-lock.json"
|
||||
pull_request:
|
||||
paths:
|
||||
- "src/Api/**"
|
||||
- "scripts/api-*.mjs"
|
||||
- "package.json"
|
||||
- "package-lock.json"
|
||||
|
||||
jobs:
|
||||
oas-validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "18"
|
||||
|
||||
- name: Install deps
|
||||
run: npm install --ignore-scripts --no-progress
|
||||
|
||||
- name: Compose aggregate OpenAPI
|
||||
run: npm run api:compose
|
||||
|
||||
- name: Lint (spectral)
|
||||
run: npm run api:lint
|
||||
|
||||
- name: Validate examples coverage
|
||||
run: npm run api:examples
|
||||
|
||||
- name: Compat diff (previous commit)
|
||||
run: |
|
||||
set -e
|
||||
if git show HEAD~1:src/Api/StellaOps.Api.OpenApi/stella.yaml > /tmp/stella-prev.yaml 2>/dev/null; then
|
||||
node scripts/api-compat-diff.mjs /tmp/stella-prev.yaml src/Api/StellaOps.Api.OpenApi/stella.yaml --output text --fail-on-breaking
|
||||
else
|
||||
echo "[oas-ci] previous stella.yaml not found; skipping"
|
||||
fi
|
||||
|
||||
- name: Contract tests
|
||||
run: npm run api:compat:test
|
||||
|
||||
- name: Upload aggregate spec
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: stella-openapi
|
||||
path: src/Api/StellaOps.Api.OpenApi/stella.yaml
|
||||
Reference in New Issue
Block a user