chore: support Python 3.14 #75
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 | |
| pull-requests: read | |
| jobs: | |
| files-changed: | |
| name: Detect which file has changed | |
| 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: "Check out repository code" | |
| uses: "actions/checkout@v6" | |
| - name: Check for file changes | |
| uses: opsmill/paths-filter@v3.0.2 | |
| id: changes | |
| with: | |
| token: ${{ github.token }} | |
| filters: .github/file-filters.yml | |
| python-lint: | |
| if: needs.files-changed.outputs.python == 'true' | |
| needs: ["files-changed"] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Both ends of requires-python, so the supported range stays honest | |
| python-version: ["3.11", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.18" | |
| python-version: ${{ matrix.python-version }} | |
| - 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-lint: | |
| if: needs.files-changed.outputs.yaml == 'true' | |
| needs: ["files-changed"] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - 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-lint: | |
| if: needs.files-changed.outputs.markdown == 'true' | |
| needs: ["files-changed"] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Run rumdl | |
| uses: rvben/rumdl@v0 | |
| with: | |
| config: pyproject.toml | |
| report-type: annotations | |
| fail-on-error: true | |
| integration-test: | |
| if: | | |
| always() && !cancelled() && | |
| !contains(needs.*.result, 'failure') && | |
| !contains(needs.*.result, 'cancelled') | |
| needs: ["python-lint", "yaml-lint", "markdown-lint"] | |
| runs-on: | |
| group: "huge-runners" | |
| timeout-minutes: 60 | |
| env: | |
| INFRAHUB_DB_TYPE: neo4j | |
| INFRAHUB_TIMEOUT: 600 | |
| INFRAHUB_TESTING_LOG_LEVEL: INFO | |
| INFRAHUB_TESTING_DOCKER_PULL: "false" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install tini | |
| run: "apt-get update && apt-get install -y tini" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - run: uv sync | |
| - name: Build custom Infrahub image | |
| run: > | |
| docker build | |
| --build-arg INFRAHUB_BASE_VERSION=1.10.0 | |
| -t registry.opsmill.io/opsmill/infrahub:1.10.0 | |
| . | |
| - name: Set environment variables | |
| run: | | |
| RUNNER_NAME=$(echo "${{ runner.name }}" | grep -o 'ghrunner[0-9]\+' | sed 's/ghrunner\([0-9]\+\)/ghrunner_\1/') | |
| echo "PYTEST_DEBUG_TEMPROOT=/var/lib/github/${RUNNER_NAME}/_temp" >> $GITHUB_ENV | |
| - name: Run tests | |
| run: exec tini -s -g -- uv run pytest tests/ | |
| 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 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| package_json_file: docs/package.json | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| cache-dependency-path: docs/pnpm-lock.yaml | |
| - name: Install Node dependencies | |
| working-directory: docs | |
| run: pnpm install --frozen-lockfile | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.18" | |
| - run: uv sync | |
| working-directory: ./ | |
| - name: Build docs website | |
| run: pnpm run build | |
| validate-documentation-style: | |
| if: | | |
| always() && !cancelled() && | |
| !contains(needs.*.result, 'failure') && | |
| !contains(needs.*.result, 'cancelled') | |
| needs: ["files-changed", "yaml-lint", "python-lint", "markdown-lint"] | |
| runs-on: "ubuntu-22.04" | |
| timeout-minutes: 5 | |
| env: | |
| VALE_VERSION: "3.13.0" | |
| steps: | |
| - uses: "actions/checkout@v6" | |
| with: | |
| submodules: true | |
| # The official GitHub Action for Vale doesn't work, installing manually instead: | |
| # https://github.com/errata-ai/vale-action/issues/103 | |
| - name: Download Vale | |
| run: | | |
| curl -sL "https://github.com/errata-ai/vale/releases/download/v${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz | |
| tar -xzf vale.tar.gz | |
| - name: "Validate documentation style" | |
| run: ./vale $(find ./docs/docs -type f \( -name "*.mdx" -o -name "*.md" \) ) |