fix(docs): register release-notes-data plugin #1254
Workflow file for this run
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: CI | |
| # yamllint disable rule:truthy rule:line-length | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Detect which files have changed to run only necessary jobs | |
| files-changed: | |
| name: Detect file changes | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| documentation: ${{ steps.changes.outputs.documentation_all }} | |
| python: ${{ steps.changes.outputs.python_all }} | |
| yaml: ${{ steps.changes.outputs.yaml_all }} | |
| markdown: ${{ steps.changes.outputs.markdown_all }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Filter changed paths | |
| uses: opsmill/paths-filter@v3.0.2 | |
| id: changes | |
| with: | |
| token: ${{ github.token }} | |
| filters: .github/file-filters.yml | |
| # Python linting job | |
| python-lint: | |
| if: needs.files-changed.outputs.python == 'true' | |
| needs: ["files-changed"] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install uv | |
| uses: "astral-sh/setup-uv@v7" | |
| with: | |
| version: "0.9.18" | |
| - run: uv sync | |
| - name: Check code formatting | |
| run: | | |
| uv run ruff format --check --diff | |
| uv run ruff check --select I . | |
| - name: Run linters | |
| run: uv run ruff check | |
| - name: Run type checks | |
| run: uv run mypy . | |
| # YAML linting job | |
| yaml-lint: | |
| if: needs.files-changed.outputs.yaml == 'true' | |
| needs: ["files-changed"] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install uv | |
| uses: "astral-sh/setup-uv@v7" | |
| with: | |
| version: "0.9.18" | |
| - run: uv sync | |
| - name: Run yamllint | |
| run: uv run yamllint -s . | |
| # Markdown linting job | |
| markdown-lint: | |
| if: needs.files-changed.outputs.markdown == 'true' | |
| needs: ["files-changed"] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| - name: Install markdownlint-cli | |
| run: npm install -g markdownlint-cli | |
| - name: Run markdownlint | |
| run: markdownlint "**/*.{md,mdx}" | |
| # Documentation build job | |
| documentation: | |
| name: Build documentation | |
| defaults: | |
| run: | |
| working-directory: ./docs | |
| if: | | |
| always() && !cancelled() && | |
| !contains(needs.*.result, 'failure') && | |
| !contains(needs.*.result, 'cancelled') && | |
| needs.files-changed.outputs.documentation == 'true' | |
| needs: ["files-changed", "yaml-lint", "python-lint", "markdown-lint"] | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 5 | |
| outputs: | |
| build-status: ${{ job.status }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Update submodules | |
| run: git submodule update --recursive --remote | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: docs/package-lock.json | |
| - name: Install Node dependencies | |
| run: npm install | |
| - name: Install uv | |
| uses: "astral-sh/setup-uv@v7" | |
| with: | |
| version: "0.9.18" | |
| - run: uv sync | |
| working-directory: ./ | |
| - name: Build documentation | |
| run: uv run invoke docs | |
| # Link checking job | |
| check-links: | |
| name: Check documentation links | |
| # TEMPORARILY DISABLED | |
| if: false | |
| # if: | | |
| # always() && !cancelled() && | |
| # !contains(needs.*.result, 'failure') && | |
| # !contains(needs.*.result, 'cancelled') && | |
| # needs.files-changed.outputs.documentation == 'true' && | |
| # needs.documentation.outputs.build-status == 'success' | |
| needs: ["files-changed", "documentation"] | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| working-directory: ./docs | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Update submodules | |
| run: git submodule update --recursive --remote | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: docs/package-lock.json | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Install sitemap2urllist | |
| run: cargo install --locked sitemap2urllist | |
| - name: Install uv | |
| uses: "astral-sh/setup-uv@v7" | |
| with: | |
| version: "0.9.18" | |
| - name: Build documentation | |
| run: uv run invoke docs | |
| - name: Start Docusaurus server | |
| run: | | |
| npm run serve & | |
| echo "Waiting for server to start..." | |
| for i in {1..100}; do | |
| if curl -s -o /dev/null http://localhost:3000; then | |
| echo "Server started successfully" | |
| break | |
| fi | |
| if [ $i -eq 100 ]; then | |
| echo "Server failed to start within timeout" | |
| exit 1 | |
| fi | |
| echo "Waiting... ($i/100)" | |
| sleep 1 | |
| done | |
| - name: Check links | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| args: | | |
| --no-progress | |
| --config ./lychee.toml | |
| --remap 'https://docs.infrahub.app http://localhost:3000' | |
| $(sitemap2urllist http://localhost:3000/sitemap.xml | sed 's,https://docs.infrahub.app,http://localhost:3000,g') | |
| fail: true | |
| jobSummary: true | |
| format: markdown | |
| output: './lychee-report.md' |