build: bump unist-util-visit from 5.0.0 to 5.1.0 #253
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Spectral Checks | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| paths: | |
| - 'src/**' | |
| - 'example/**' | |
| - '__tests__/**' | |
| - '.spectral.yaml' | |
| - '*.oas.rules.*' | |
| - 'package.json' | |
| - 'tsconfig.json' | |
| - 'jest.config.*' | |
| branches: | |
| - main | |
| jobs: | |
| changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| # Required permissions | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| # Set job outputs to values from filter step | |
| outputs: | |
| run_ci: ${{ steps.filter.outputs.ci }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Filter paths | |
| id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| ci: | |
| - 'src/**' | |
| - 'example/**' | |
| - '__tests__/**' | |
| - '.spectral.yaml' | |
| - '*.oas.rules.*' | |
| - 'package.json' | |
| - 'tsconfig.json' | |
| - 'jest.config.*' | |
| lint-example-openapi: | |
| name: Lint Example OpenAPI | |
| needs: changes | |
| if: ${{ needs.changes.outputs.run_ci == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Use Node.js LTS | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build ruleset (TS + legacy JS) | |
| run: npm run build | |
| - name: Lint example OpenAPI | |
| run: | | |
| npx spectral --version | |
| npx spectral lint "./example/*.{json,yml,yaml}" -f github-actions | |
| run-typescript-tests: | |
| name: Run Tests | |
| needs: changes | |
| if: ${{ needs.changes.outputs.run_ci == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: write | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Use Node.js LTS | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run TypeScript tests with coverage | |
| run: npm run test -- --coverage | |
| - name: Upload Jest coverage report | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| - name: Publish Jest test results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: coverage/junit.xml |