Skip to content

Commit 095c511

Browse files
committed
run our docker ci on gha runners directly
1 parent 60bba4e commit 095c511

File tree

1 file changed

+46
-17
lines changed

1 file changed

+46
-17
lines changed

.github/workflows/ci.yml

+46-17
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,57 @@ concurrency:
1414
cancel-in-progress: true
1515
jobs:
1616
build:
17-
if: github.repository == 'pypi/warehouse'
18-
runs-on: depot-ubuntu-24.04-arm
17+
runs-on: ubuntu-24.04-arm
1918
outputs:
20-
buildId: ${{ steps.build.outputs.build-id}}
19+
buildId: ${{ github.run_id }}
2120
permissions:
22-
id-token: write
21+
packages: write
2322
steps:
2423
- name: Check out repository
2524
uses: actions/checkout@v4
2625
with:
2726
persist-credentials: false
28-
- name: Set up Depot CLI
29-
uses: depot/setup-action@v1
30-
- name: Build image
31-
id: build
32-
uses: depot/build-push-action@v1
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3 # zizmor: ignore[cache-poisoning]
29+
- name: Cache
30+
uses: actions/cache@v3 # zizmor: ignore[cache-poisoning]
31+
id: cache
3332
with:
34-
save: true
33+
path: |
34+
var-cache-apt
35+
var-lib-apt
36+
root-cache-pip
37+
root-npm
38+
key: cache-${{ hashFiles('Dockerfile') }}
39+
- name: inject cache into docker
40+
uses: reproducible-containers/[email protected]
41+
with:
42+
cache-map: |
43+
{
44+
"var-cache-apt": "/var/cache/apt",
45+
"var-lib-apt": "/var/lib/apt",
46+
"root-cache-pip": "/root/.cache/pip",
47+
"root-npm": "/root/.npm"
48+
}
49+
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
50+
- name: Login To GHCR
51+
uses: docker/login-action@v3
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Build and push
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: .
60+
cache-from: type=gha
61+
cache-to: type=gha,mode=max
62+
push: true
3563
build-args: |
3664
DEVEL=yes
3765
CI=yes
38-
tags: pypi/warehouse:ci-${{ github.run_id }}
66+
tags: |
67+
ghcr.io/pypi/warehouse:ci-${{ github.run_id }}
3968
test:
4069
# Time out if our test suite has gotten hung
4170
timeout-minutes: 15
@@ -59,13 +88,13 @@ jobs:
5988
command: bin/licenses
6089
- name: Translations
6190
command: bin/translations
62-
runs-on: ${{ (matrix.runs_on != null) && matrix.runs_on || 'depot-ubuntu-24.04-arm' }}
91+
runs-on: ubuntu-24.04-arm
6392
container:
64-
image: registry.depot.dev/rltf7cln5v:${{ needs.build.outputs.buildId }}
93+
image: ghcr.io/pypi/warehouse:ci-${{ needs.build.outputs.buildId }}
6594
env:
6695
BILLING_BACKEND: warehouse.subscriptions.services.MockStripeBillingService api_base=http://stripe:12111 api_version=2020-08-27
6796
permissions:
68-
id-token: write
97+
packages: read
6998
services:
7099
postgres:
71100
image: ${{ (matrix.name == 'Tests') && 'postgres:16.1' || '' }}
@@ -103,12 +132,12 @@ jobs:
103132
check_db:
104133
name: Check Database Consistency
105134
needs: build
106-
runs-on: depot-ubuntu-24.04-arm
135+
runs-on: ubuntu-24.04-arm
107136
continue-on-error: true
108137
container:
109-
image: registry.depot.dev/rltf7cln5v:${{ needs.build.outputs.buildId }}
138+
image: ghcr.io/pypi/warehouse:ci-${{ needs.build.outputs.buildId }}
110139
permissions:
111-
id-token: write
140+
packages: read
112141
services:
113142
postgres:
114143
image: postgres:16.1

0 commit comments

Comments
 (0)