chore(deps): lock file maintenance #427
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: | |
| branches: [main] | |
| tags: ["**"] | |
| pull_request: | |
| branches: [main] | |
| merge_group: | |
| branches: [main] | |
| workflow_call: | |
| workflow_dispatch: | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }} | |
| jobs: | |
| python: | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python: [3.12] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| ENVIRONMENT: ci | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5 | |
| - id: setup-python | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Set up environment | |
| if: ${{ runner.os != 'Windows' }} | |
| run: | | |
| mkdir -p .venv | |
| echo "$(realpath .venv)/bin" >> "${GITHUB_PATH}" | |
| - name: Set up environment (Windows) | |
| if: ${{ runner.os == 'Windows' }} | |
| run: | | |
| New-Item -Type Directory -Force .venv | |
| "$(Resolve-Path .venv)/Scripts" | Out-File -FilePath "${env:GITHUB_PATH}" -Append | |
| - run: | | |
| uv lock --check | |
| uv sync --frozen | |
| - run: make lint test | |
| docker: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| env: | |
| GHCR_IMAGE_NAME: ghcr.io/${{ github.repository }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| sparse-checkout: | | |
| Dockerfile | |
| uv.lock | |
| - uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4 | |
| with: | |
| path: | | |
| var-cache-apt | |
| var-lib-apt | |
| root-cache-uv | |
| key: buildkit-mounts-${{ runner.os }}-${{ hashFiles('**/Dockerfile', '**/*.lock') }} | |
| restore-keys: | | |
| buildkit-mounts-${{ runner.os }} | |
| - uses: reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de # v3 | |
| with: | |
| cache-map: | | |
| { | |
| "var-cache-apt": "/var/cache/apt", | |
| "var-lib-apt": "/var/lib/apt", | |
| "root-cache-uv": "/root/.cache/uv" | |
| } | |
| - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 | |
| - id: build-ci | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6 | |
| with: | |
| target: ${{ env.ENVIRONMENT }} | |
| cache-from: | | |
| ${{ env.GHCR_IMAGE_NAME }}:dev | |
| ${{ env.GHCR_IMAGE_NAME }}:cache | |
| load: true | |
| env: | |
| ENVIRONMENT: ci | |
| - run: docker run --rm ${{ steps.build-ci.outputs.imageid }} | |
| - id: docker_metadata | |
| uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5 | |
| with: | |
| images: ${{ env.GHCR_IMAGE_NAME }} | |
| - if: ${{ github.event_name == 'push' || github.ref_name == github.event.repository.default_branch }} | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - if: ${{ github.event_name == 'push' || github.ref_name == github.event.repository.default_branch }} | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6 | |
| with: | |
| target: ${{ env.ENVIRONMENT }} | |
| cache-from: | | |
| ${{ env.GHCR_IMAGE_NAME }}:dev | |
| ${{ env.GHCR_IMAGE_NAME }}:cache | |
| cache-to: type=inline | |
| tags: ${{ env.GHCR_IMAGE_NAME }}:dev | |
| push: ${{ github.event_name == 'push' || github.ref_name == github.event.repository.default_branch }} | |
| env: | |
| ENVIRONMENT: dev | |
| - if: ${{ github.event_name == 'push' || github.ref_name == github.event.repository.default_branch }} | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6 | |
| with: | |
| cache-from: | | |
| ${{ env.GHCR_IMAGE_NAME }}:dev | |
| ${{ env.GHCR_IMAGE_NAME }}:cache | |
| cache-to: type=registry,ref=${{ env.GHCR_IMAGE_NAME }}:cache,mode=max | |
| tags: ${{ steps.docker_metadata.outputs.tags }} | |
| labels: ${{ steps.docker_metadata.outputs.labels }} | |
| annotations: ${{ steps.docker_metadata.outputs.annotations }} | |
| push: ${{ github.event_name == 'push' || github.ref_name == github.event.repository.default_branch }} | |
| env: | |
| ENVIRONMENT: prod |