Bump the uv group across 1 directory with 12 updates #392
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
| --- | |
| # yamllint disable rule:truthy rule:truthy rule:line-length | |
| name: "CI" | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| VALE_VERSION: "3.13.0" | |
| 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" | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.12" | |
| timeout-minutes: 5 | |
| steps: | |
| - name: "Check out repository code" | |
| uses: "actions/checkout@v6" | |
| - name: "Set up Python ${{ matrix.python-version }}" | |
| uses: "actions/setup-python@v6" | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: "Install uv" | |
| uses: "astral-sh/setup-uv@v7" | |
| with: | |
| version: "0.9.18" | |
| - name: "Install dependencies" | |
| run: "uv sync --group dev" | |
| - name: "Linting: ruff check" | |
| run: "uv run ruff check ." | |
| - name: "Linting: ruff format" | |
| run: "uv run ruff format --check --diff ." | |
| - name: "Mypy Tests" | |
| run: "uv run mypy --show-error-codes emma pages" | |
| - name: "Pylint Tests" | |
| run: "uv run pylint emma pages *.py" | |
| yaml-lint: | |
| if: needs.files-changed.outputs.yaml == 'true' | |
| needs: ["files-changed"] | |
| runs-on: "ubuntu-latest" | |
| timeout-minutes: 5 | |
| steps: | |
| - name: "Check out repository code" | |
| uses: "actions/checkout@v6" | |
| with: | |
| submodules: true | |
| - name: "Install uv" | |
| uses: "astral-sh/setup-uv@v7" | |
| with: | |
| version: "0.9.18" | |
| - name: "Install dependencies" | |
| run: "uv sync --group dev" | |
| - name: "Linting: 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: | |
| - name: "Check out repository code" | |
| uses: "actions/checkout@v6" | |
| - name: "Install NodeJS" | |
| 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: | |
| 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: | |
| - name: "Check out repository code" | |
| uses: "actions/checkout@v6" | |
| with: | |
| submodules: true | |
| - name: Install NodeJS | |
| 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 uv" | |
| uses: "astral-sh/setup-uv@v7" | |
| with: | |
| version: "0.9.18" | |
| - name: "Install Python dependencies" | |
| run: "uv sync" | |
| working-directory: ./ | |
| - name: "Build docs website" | |
| run: "uv run invoke docs" | |
| working-directory: ./ | |
| 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 | |
| steps: | |
| - name: "Check out repository code" | |
| 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 | |
| env: | |
| VALE_VERSION: ${{ env.VALE_VERSION }} | |
| - name: "Validate documentation style" | |
| run: ./vale $(find ./docs -type f \( -name "*.mdx" -o -name "*.md" \) | grep -v node_modules) | |
| streamlit-test: | |
| if: needs.files-changed.outputs.python == 'true' | |
| needs: ["files-changed"] | |
| runs-on: "ubuntu-latest" | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.12" | |
| timeout-minutes: 5 | |
| steps: | |
| - name: "Check out repository code" | |
| uses: "actions/checkout@v6" | |
| - name: "Set up Python ${{ matrix.python-version }}" | |
| uses: "actions/setup-python@v6" | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: "Install uv" | |
| uses: "astral-sh/setup-uv@v7" | |
| with: | |
| version: "0.9.18" | |
| - name: "Install dependencies" | |
| run: "uv sync" | |
| - name: "Run Streamlit" | |
| run: | | |
| timeout 30s uv run streamlit run main.py & | |
| PID=$! | |
| sleep 10 | |
| if ps -p $PID > /dev/null; then | |
| kill $PID | |
| exit 0 | |
| else | |
| exit 1 | |
| fi |