Skip to content

Commit 02d9c44

Browse files
committed
ci: run lint and tests with --frozen
1 parent 5153c31 commit 02d9c44

File tree

3 files changed

+69
-69
lines changed

3 files changed

+69
-69
lines changed
Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
11
name: Build and Test Docker Image
22

33
on:
4-
pull_request:
5-
branches: ["main"]
6-
workflow_dispatch:
4+
pull_request:
5+
branches: ["main"]
6+
workflow_dispatch:
77

88
jobs:
9-
should-test-docker-build:
10-
permissions:
11-
contents: read
12-
pull-requests: read
13-
name: Check if should `test_docker_build` run
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Check out the repo
17-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9+
should-test-docker-build:
10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
name: Check if should `test_docker_build` run
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1818

19-
- name: Check if Dockerfile changed
20-
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
21-
id: docker-changes
22-
with:
23-
filters: |
24-
docker:
25-
- 'Dockerfile'
26-
- '.dockerignore'
27-
workflow:
28-
- ./.github/actions/docker-build/action.yml
29-
outputs:
30-
docker: ${{ steps.docker-changes.outputs.docker }}
31-
workflow: ${{ steps.docker-changes.outputs.workflow }}
19+
- name: Check if Dockerfile changed
20+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
21+
id: docker-changes
22+
with:
23+
filters: |
24+
docker:
25+
- 'Dockerfile'
26+
- '.dockerignore'
27+
workflow:
28+
- ./.github/actions/docker-build/action.yml
29+
outputs:
30+
docker: ${{ steps.docker-changes.outputs.docker }}
31+
workflow: ${{ steps.docker-changes.outputs.workflow }}
3232

33-
test-docker-build:
34-
needs: [should-test-docker-build]
35-
name: Test Docker build ${{ matrix.arch }}
36-
runs-on: ubuntu-latest
37-
if: (needs.should-test-docker-build.outputs.workflow == 'true' || needs.should-test-docker-build.outputs.docker == 'true')
38-
permissions:
39-
contents: read
40-
packages: read
41-
strategy:
42-
matrix:
43-
include:
44-
- arch: amd64
45-
platform: linux/amd64
46-
image-name: build-amd64
47-
needs-qemu: false
48-
- arch: arm64
49-
platform: linux/arm64
50-
image-name: build-arm64
51-
needs-qemu: true
52-
steps:
53-
- name: Check out the repo
54-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33+
test-docker-build:
34+
needs: [should-test-docker-build]
35+
name: Test Docker build
36+
runs-on: ubuntu-latest
37+
if: (needs.should-test-docker-build.outputs.workflow == 'true' || needs.should-test-docker-build.outputs.docker == 'true')
38+
permissions:
39+
contents: read
40+
packages: read
41+
strategy:
42+
matrix:
43+
include:
44+
- arch: amd64
45+
platform: linux/amd64
46+
image-name: build-amd64
47+
needs-qemu: false
48+
- arch: arm64
49+
platform: linux/arm64
50+
image-name: build-arm64
51+
needs-qemu: true
52+
steps:
53+
- name: Check out the repo
54+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5555

56-
- name: Log in to GitHub Container Registry
57-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
58-
with:
59-
registry: ghcr.io
60-
username: ${{ github.actor }}
61-
password: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Log in to GitHub Container Registry
57+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
58+
with:
59+
registry: ghcr.io
60+
username: ${{ github.actor }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
6262

63-
- name: Build image
64-
uses: ./.github/actions/docker-build
65-
with:
66-
context: .
67-
file: ./Dockerfile
68-
push: false
69-
load: true
70-
platforms: ${{ matrix.platform }}
71-
cache-from: type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache-${{ matrix.arch }}
72-
image-name: ${{ matrix.image-name }}
73-
setup-qemu: ${{ matrix.needs-qemu }}
63+
- name: Build image
64+
uses: ./.github/actions/docker-build
65+
with:
66+
context: .
67+
file: ./Dockerfile
68+
push: false
69+
load: true
70+
platforms: ${{ matrix.platform }}
71+
cache-from: type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache-${{ matrix.arch }}
72+
image-name: ${{ matrix.image-name }}
73+
setup-qemu: ${{ matrix.needs-qemu }}
7474

75-
- name: Test
76-
run: |
77-
docker run --platform ${{ matrix.platform }} --rm ${{ matrix.image-name }}:pr-${{ github.event.pull_request.number }} --version
75+
- name: Test
76+
run: |
77+
docker run --platform ${{ matrix.platform }} --rm ${{ matrix.image-name }}:pr-${{ github.event.pull_request.number }} --version

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
2020

2121
- name: Install the project
22-
run: uv sync --locked --group dev
22+
run: uv sync --frozen --group dev
2323

2424
- name: Cache mypy cache
2525
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.1

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
2525

2626
- name: Install the dependencies
27-
run: uv sync --locked --group dev --all-extras --python ${{ matrix.python-version }}
27+
run: uv sync --frozen --group dev --all-extras --python ${{ matrix.python-version }}
2828

2929
- name: Run tests
3030
run: uv run pytest tests

0 commit comments

Comments
 (0)