-
Notifications
You must be signed in to change notification settings - Fork 36
82 lines (69 loc) · 1.78 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
bootstrap:
runs-on: ubuntu-latest
services:
postgres:
env:
POSTGRES_PASSWORD: secret
image: postgres:16.2-alpine
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-retries 5
--health-timeout 5s
ports:
- 5432:5432
env:
DATABASE_URL: postgres://postgres:secret@localhost:5432/postgres
steps:
- name: checkout
uses: actions/checkout@v4
- name: build
uses: ./.github/actions/build
- name: bootstrap
run: |
. venv/bin/activate
make bootstrap
- name: lint the generated project
run: |
. venv/bin/activate
cd testproject
make lint
- name: save the bootstrap result
uses: actions/upload-artifact@v4
with:
name: generated
path: testproject
include-hidden-files: true
build-docker-image:
needs: bootstrap
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: build
uses: ./.github/actions/build
- name: download build artifact
uses: actions/download-artifact@v4
with:
name: generated
path: testproject
- name: setup qemu
uses: docker/setup-qemu-action@v3
- name: setup buildx
uses: docker/setup-buildx-action@v3
- name: make sure docker image is buildable
uses: docker/build-push-action@v6
with:
build-args: |
PYTHON_VERSION=${{ env.python-version }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: testproject
push: false