1
- name : CI Base
1
+ name : CI
2
2
on :
3
- workflow_call :
4
- inputs :
5
- runner :
6
- required : true
7
- type : string
8
- description : ' Runner to use for jobs'
9
- runner_large :
10
- required : false
11
- type : string
12
- description : ' Large runner to use for heavy jobs'
13
- image_registry :
14
- required : true
15
- type : string
16
- description : ' Container registry for images'
17
- build_id :
18
- required : true
19
- type : string
20
- description : ' Build ID for the container image'
21
- use_depot :
22
- required : false
23
- type : boolean
24
- default : false
25
- description : ' Whether to use Depot for builds'
26
-
3
+ push :
4
+ branches :
5
+ - main
6
+ pull_request :
7
+ merge_group :
8
+ types : [checks_requested]
9
+ workflow_dispatch : # generally only for the "combine-prs" workflow
10
+ permissions :
11
+ contents : read
12
+ concurrency :
13
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
14
+ cancel-in-progress : true
27
15
jobs :
16
+ build :
17
+ if : github.repository == 'pypi/warehouse'
18
+ runs-on : depot-ubuntu-24.04-arm
19
+ outputs :
20
+ buildId : ${{ steps.build.outputs.build-id}}
21
+ permissions :
22
+ id-token : write
23
+ steps :
24
+ - name : Check out repository
25
+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26
+ with :
27
+ persist-credentials : false
28
+ - name : Set up Depot CLI
29
+ uses : depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5 # v1.6.0
30
+ - name : Build image
31
+ id : build
32
+ uses : depot/build-push-action@9785b135c3c76c33db102e45be96a25ab55cd507 # v1.16.2
33
+ with :
34
+ save : true
35
+ build-args : |
36
+ DEVEL=yes
37
+ CI=yes
38
+ tags : pypi/warehouse:ci-${{ github.run_id }}
28
39
test :
29
40
# Time out if our test suite has gotten hung
30
41
timeout-minutes : 15
42
+ needs : build
31
43
strategy :
32
44
matrix :
33
45
include :
34
46
- name : Tests
35
47
command : bin/tests --postgresql-host postgres
36
- use_large_runner : true
48
+ runs_on : depot-ubuntu-24.04-arm-4
37
49
- name : Lint
38
50
command : bin/lint
39
- use_large_runner : true
51
+ runs_on : depot-ubuntu-24.04-arm-4
40
52
- name : User Documentation
41
53
command : bin/user-docs
42
54
- name : Developer Documentation
@@ -47,14 +59,13 @@ jobs:
47
59
command : bin/licenses
48
60
- name : Translations
49
61
command : bin/translations
50
- runs-on : ${{ (matrix.use_large_runner && inputs.runner_large != '' ) && inputs.runner_large || inputs.runner }}
62
+ runs-on : ${{ (matrix.runs_on != null ) && matrix.runs_on || 'depot-ubuntu-24.04-arm' }}
51
63
container :
52
- image : ${{ inputs.image_registry }} :${{ inputs.build_id }}
64
+ image : registry.depot.dev/rltf7cln5v :${{ needs.build.outputs.buildId }}
53
65
env :
54
66
BILLING_BACKEND : warehouse.subscriptions.services.MockStripeBillingService api_base=http://stripe:12111 api_version=2020-08-27
55
67
permissions :
56
68
id-token : write
57
- packages : read
58
69
services :
59
70
postgres :
60
71
image : ${{ (matrix.name == 'Tests') && 'postgres:17.5' || '' }}
73
84
image : ${{ (matrix.name == 'Tests') && 'stripe/stripe-mock:v0.162.0' || '' }}
74
85
ports :
75
86
- 12111:12111
76
- name : ${{ matrix.name }}${{ !inputs.use_depot && ' (GHA)' || '' }}
87
+ name : ${{ matrix.name }}
77
88
steps :
78
89
- name : Check out repository
79
90
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -90,14 +101,14 @@ jobs:
90
101
run : ${{ matrix.command }}
91
102
92
103
check_db :
93
- name : Check Database Consistency${{ !inputs.use_depot && ' (GHA)' || '' }}
94
- runs-on : ${{ inputs.runner }}
104
+ name : Check Database Consistency
105
+ needs : build
106
+ runs-on : depot-ubuntu-24.04-arm
95
107
continue-on-error : true
96
108
container :
97
- image : ${{ inputs.image_registry }} :${{ inputs.build_id }}
109
+ image : registry.depot.dev/rltf7cln5v :${{ needs.build.outputs.buildId }}
98
110
permissions :
99
111
id-token : write
100
- packages : read
101
112
services :
102
113
postgres :
103
114
image : postgres:17.5
@@ -128,4 +139,4 @@ jobs:
128
139
run : bin/db-check
129
140
env :
130
141
# override the hostname set in `dev/environment`
131
- DATABASE_URL : ' postgresql+psycopg://postgres@postgres/warehouse'
142
+ DATABASE_URL : ' postgresql+psycopg://postgres@postgres/warehouse'
0 commit comments