1
- name : CI
1
+ name : CI Base
2
2
on :
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
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
+
15
27
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 }}
39
28
test :
40
29
# Time out if our test suite has gotten hung
41
30
timeout-minutes : 15
42
- needs : build
43
31
strategy :
44
32
matrix :
45
33
include :
46
34
- name : Tests
47
35
command : bin/tests --postgresql-host postgres
48
- runs_on : depot-ubuntu-24.04-arm-4
36
+ use_large_runner : true
49
37
- name : Lint
50
38
command : bin/lint
51
- runs_on : depot-ubuntu-24.04-arm-4
39
+ use_large_runner : true
52
40
- name : User Documentation
53
41
command : bin/user-docs
54
42
- name : Developer Documentation
@@ -59,13 +47,14 @@ jobs:
59
47
command : bin/licenses
60
48
- name : Translations
61
49
command : bin/translations
62
- runs-on : ${{ (matrix.runs_on != null ) && matrix.runs_on || 'depot-ubuntu-24.04-arm' }}
50
+ runs-on : ${{ (matrix.use_large_runner && inputs.runner_large != '' ) && inputs.runner_large || inputs.runner }}
63
51
container :
64
- image : registry.depot.dev/rltf7cln5v :${{ needs.build.outputs.buildId }}
52
+ image : ${{ inputs.image_registry }} :${{ inputs.build_id }}
65
53
env :
66
54
BILLING_BACKEND : warehouse.subscriptions.services.MockStripeBillingService api_base=http://stripe:12111 api_version=2020-08-27
67
55
permissions :
68
56
id-token : write
57
+ packages : read
69
58
services :
70
59
postgres :
71
60
image : ${{ (matrix.name == 'Tests') && 'postgres:17.5' || '' }}
84
73
image : ${{ (matrix.name == 'Tests') && 'stripe/stripe-mock:v0.162.0' || '' }}
85
74
ports :
86
75
- 12111:12111
87
- name : ${{ matrix.name }}
76
+ name : ${{ matrix.name }}${{ !inputs.use_depot && ' (GHA)' || '' }}
88
77
steps :
89
78
- name : Check out repository
90
79
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -101,14 +90,14 @@ jobs:
101
90
run : ${{ matrix.command }}
102
91
103
92
check_db :
104
- name : Check Database Consistency
105
- needs : build
106
- runs-on : depot-ubuntu-24.04-arm
93
+ name : Check Database Consistency${{ !inputs.use_depot && ' (GHA)' || '' }}
94
+ runs-on : ${{ inputs.runner }}
107
95
continue-on-error : true
108
96
container :
109
- image : registry.depot.dev/rltf7cln5v :${{ needs.build.outputs.buildId }}
97
+ image : ${{ inputs.image_registry }} :${{ inputs.build_id }}
110
98
permissions :
111
99
id-token : write
100
+ packages : read
112
101
services :
113
102
postgres :
114
103
image : postgres:17.5
@@ -139,4 +128,4 @@ jobs:
139
128
run : bin/db-check
140
129
env :
141
130
# override the hostname set in `dev/environment`
142
- DATABASE_URL : ' postgresql+psycopg://postgres@postgres/warehouse'
131
+ DATABASE_URL : ' postgresql+psycopg://postgres@postgres/warehouse'
0 commit comments