cloudflare test 1 #7
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 | |
| on: | |
| - push | |
| permissions: | |
| contents: 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 }} | |
| steps: | |
| - name: "Check out repository code" | |
| uses: "actions/checkout@v5" | |
| - 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 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - run: | | |
| pip install uv | |
| uv sync | |
| - run: | | |
| echo "Formatting code" | |
| uv run ruff format | |
| uv run ruff check --select I --fix . | |
| - run: | | |
| echo "Running linters" | |
| uv run ruff check | |
| - run: | | |
| echo "Running type checks" | |
| uv run mypy . | |
| yaml-lint: | |
| if: needs.files-changed.outputs.yaml == 'true' | |
| needs: ["files-changed"] | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - run: | | |
| pip install uv | |
| uv sync | |
| - run: | | |
| echo "Running validation" | |
| uv run yamllint -d "{extends: default, ignore: [.github/, .venv/ , .dev/ ]}" \ | |
| -d "{rules: {truthy: {allowed-values: ['true', 'false', 'yes', 'no', 'on', 'off', 'True', 'False']}}}" . | |
| integration-test: | |
| needs: ["python-lint", "yaml-lint"] | |
| runs-on: | |
| group: "huge-runners" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| timeout-minutes: 60 | |
| env: | |
| INFRAHUB_DB_TYPE: neo4j | |
| INFRAHUB_API_TOKEN: '06438eb2-8019-4776-878c-0941b1f1d1ec' | |
| INFRAHUB_TIMEOUT: 600 | |
| INFRAHUB_TESTING_LOG_LEVEL: INFO | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - run: | | |
| pip install uv | |
| uv sync | |
| - 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: "uv run pytest tests/ -vv" | |
| env: | |
| REPOSITORY_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| 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"] | |
| runs-on: "ubuntu-22.04" | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: docs/package-lock.json | |
| - name: "Install dependencies" | |
| run: npm install | |
| - run: | | |
| pip install uv | |
| uv sync | |
| - name: "Build docs website" | |
| run: "uv run invoke docs" | |
| validate-documentation-style: | |
| if: | | |
| always() && !cancelled() && | |
| !contains(needs.*.result, 'failure') && | |
| !contains(needs.*.result, 'cancelled') | |
| needs: ["files-changed", "yaml-lint", "python-lint"] | |
| runs-on: "ubuntu-22.04" | |
| timeout-minutes: 5 | |
| env: | |
| VALE_VERSION: "3.7.1" | |
| steps: | |
| - uses: "actions/checkout@v5" | |
| 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" \) ) |