This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (106 loc) · 3.35 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Run CI
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
env:
IMAGE_NAME: openformulieren/open-forms-ext-stuf-zds-payments
jobs:
tests:
name: Run the Django test suite
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12', '3.10']
ref:
- master
- stable/2.7.x
exclude:
- python-version: '3.12'
ref: stable/2.7.x
- python-version: '3.10'
ref: master
services:
postgres:
image: postgres:14
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# Needed because the postgres container does not provide a healthcheck
options:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
--name postgres
redis:
image: redis:6
ports:
- 6379:6379
steps:
- name: Checkout Open Forms
uses: actions/checkout@v4
with:
repository: open-formulieren/open-forms
path: open-forms
- name: Checkout StUF-ZDS payments extension
uses: actions/checkout@v4
with:
path: extension
ref: ${{ matrix.ref }}
- name: Set up backend environment
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gettext postgresql-client gdal-bin'
python-version: ${{ matrix.python-version }}
optimize-postgres: 'yes'
pg-service: 'postgres'
setup-node: 'yes'
nvmrc-custom-dir: 'open-forms'
npm-ci-flags: '--legacy-peer-deps'
working-directory: ${{ github.workspace }}/open-forms
- name: Make symlink in OF to the extension
run: |
ln -s ${{ github.workspace }}/extension/stuf_zds_payments ${{ github.workspace }}/open-forms/src
- name: Run tests
run: |
export OPEN_FORMS_EXTENSIONS=stuf_zds_payments
python src/manage.py compilemessages
coverage run --source=stuf_zds_payments src/manage.py test stuf_zds_payments
coverage combine
coverage xml -o coverage-extension.xml
env:
DJANGO_SETTINGS_MODULE: openforms.conf.ci
SECRET_KEY: dummy
DB_USER: postgres
DB_PASSWORD: ''
working-directory: ${{ github.workspace }}/open-forms
- name: Publish coverage report
uses: codecov/codecov-action@v4
with:
root_dir: ${{ github.workspace }}/extension
working-directory: ${{ github.workspace }}/open-forms
files: ./coverage-extension.xml
publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs:
- tests
environment: release
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build sdist and wheel
run: |
pip install pip build --upgrade
python -m build --sdist --wheel
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1