chore(deps): bump the actions-deps group across 1 directory with 2 up… #391
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.12", "3.14"] | |
| os: [ubuntu-latest] | |
| # one that matches "project-name".lower().replace('-', '_'), one that doesn’t: | |
| package-name: [project_name, package_alt] | |
| env: | |
| PROJECT_ROOT: project-name | |
| steps: | |
| # Setup | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set git identity | |
| run: | | |
| git config --global user.name "scverse-bot" | |
| git config --global user.email "108668866+scverse-bot@users.noreply.github.com" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache-dependency-glob: "{{cookiecutter.project_name}}/pyproject.toml" | |
| - name: Install Ubuntu system dependencies | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get install pandoc | |
| - name: Install build & check dependencies | |
| run: | | |
| uv tool install prek | |
| uv tool install cruft | |
| uv tool install hatch | |
| # Build | |
| - name: Build from template | |
| run: cruft create . --no-input --extra-context='{"package_name":"${{ matrix.package-name }}"}' | |
| # Check | |
| - name: Run prek | |
| run: | | |
| cd "$PROJECT_ROOT" | |
| git add . | |
| prek run --verbose --color=always --show-diff-on-failure --all-files | |
| - name: Install the package and check if it can be imported | |
| run: | | |
| cd "$PROJECT_ROOT" | |
| uv run python -c "import ${{ matrix.package-name }}" | |
| # Docs | |
| - name: Build the documentation | |
| if: matrix.python == '3.14' | |
| run: | | |
| cd "$PROJECT_ROOT" | |
| hatch run docs:build | |
| test-scripts: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set git identity | |
| run: | | |
| git config --global user.name "scverse-bot" | |
| git config --global user.email "108668866+scverse-bot@users.noreply.github.com" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| cache-dependency-glob: scripts/pyproject.toml | |
| - name: set git default branch | |
| run: git config --global init.defaultBranch main | |
| - name: Run tests | |
| env: | |
| SCVERSE_BOT_READONLY_GITHUB_TOKEN: ${{ secrets.SCVERSE_BOT_READONLY_GITHUB_TOKEN }} | |
| # PYTHONTRACEMALLOC: '20' # uncomment when debugging unclosed resources | |
| working-directory: ./scripts | |
| run: uvx hatch test --color=yes | |
| check: | |
| if: always() | |
| needs: | |
| - test | |
| - test-scripts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |