build(deps): bump the actions group with 2 updates #1394
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '.github/dependabot.yml' | |
| - '.gitattributes' | |
| - '.gitignore' | |
| - '.pre-commit-config.yaml' | |
| - 'CONTRIBUTING.md' | |
| - 'LICENSE' | |
| - 'README.md' | |
| pull_request: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '.github/dependabot.yml' | |
| - '.gitattributes' | |
| - '.gitignore' | |
| - '.pre-commit-config.yaml' | |
| - 'CONTRIBUTING.md' | |
| - 'LICENSE' | |
| - 'README.md' | |
| workflow_dispatch: | |
| env: | |
| DOCKER_REGISTRY: ghcr.io | |
| DOCKER_IMAGE: ${{ github.repository }} | |
| jobs: | |
| check-lint: | |
| name: Check lint | |
| runs-on: ubuntu-latest | |
| container: debian:bookworm | |
| permissions: | |
| contents: read | |
| steps: | |
| # 6.0.2 | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| # 7.2.0 | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| version: "0.9.21" | |
| enable-cache: true | |
| save-cache: ${{ github.ref == 'refs/heads/master' }} | |
| cache-dependency-glob: | | |
| **/uv.lock | |
| **/pyproject.toml | |
| - name: Install system packages | |
| run: | | |
| # Needed when Python packages below requiring building from | |
| # source using cc e.g. pycairo | |
| apt update | |
| apt install -y build-essential pkg-config libcairo2-dev \ | |
| libgirepository1.0-dev python3-dev | |
| - name: Sync uv environment | |
| run: uv sync --all-extras --all-groups --frozen --allow-python-downloads | |
| - name: Check code formatting | |
| run: uv run ruff format --check | |
| - name: Check code lint | |
| run: uv run ruff check --output-format=github | |
| - name: Check Python types | |
| run: uv run mypy . | |
| build-and-test-container: | |
| name: Build and test container | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| # 6.0.2 | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Docker Buildx | |
| # 4.0.0 | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 | |
| - name: Build container | |
| id: docker_build | |
| # 7.1.0 | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| tags: ${{ env.DOCKER_IMAGE }}:build | |
| push: false | |
| load: true | |
| cache-from: type=registry,ref=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:latest | |
| cache-to: type=inline | |
| - name: Run tests in container | |
| run: | | |
| docker run -v $PWD:$PWD -w $PWD --entrypoint bash "$DOCKER_IMAGE":build -c \ | |
| "apt-get install python3-coverage && python3 -m coverage run -m unittest discover --verbose --buffer" | |
| - name: Cache pip downloads | |
| # 5.0.5 | |
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae | |
| with: | |
| path: ~/.pip | |
| key: pip-${{ runner.os }}-coveralls-4.1.0 | |
| restore-keys: | | |
| pip-${{ runner.os }}- | |
| - name: Submit code coverage to Coveralls.io | |
| if: | | |
| (github.event_name == 'push' && | |
| github.ref == 'refs/heads/master') || | |
| (github.event_name == 'pull_request' && | |
| github.event.pull_request.head.repo.fork == false) | |
| env: | |
| PIP_CACHE_DIR: "~/.pip" | |
| COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| python3 -m venv venv | |
| . venv/bin/activate | |
| # Bump cache key above | |
| pip install 'coveralls==4.1.0' | |
| coveralls | |
| - name: Login to registry | |
| if: github.event_name != 'pull_request' | |
| # 4.1.0 | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee | |
| with: | |
| registry: ${{ env.DOCKER_REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push image to registry | |
| if: github.event_name != 'pull_request' | |
| # 7.1.0 | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| tags: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:latest | |
| push: true | |
| - name: Login to ghcr.io using Flathub credentials | |
| if: github.event_name != 'pull_request' | |
| # 4.1.0 | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee | |
| with: | |
| registry: ghcr.io | |
| username: ${{ secrets.FLATHUB_ORG_USER }} | |
| password: ${{ secrets.FLATHUB_ORG_TOKEN }} | |
| - name: Push image to the old location | |
| if: github.event_name != 'pull_request' | |
| # 7.1.0 | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| tags: ghcr.io/flathub/flatpak-external-data-checker:latest | |
| push: true | |
| - name: Save pip downloads cache | |
| # 5.0.5 | |
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae | |
| if: github.repository == 'flathub-infra/flatpak-external-data-checker' && github.ref == 'refs/heads/master' | |
| with: | |
| path: ~/.pip | |
| key: pip-${{ runner.os }}-coveralls-4.1.0 |