-
Notifications
You must be signed in to change notification settings - Fork 70
76 lines (65 loc) · 2.21 KB
/
ci.yaml
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
name: CI
on:
pull_request:
push:
branches:
- main
# The goal here is to cancel older workflows when a PR is updated (because it's pointless work)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
generate:
name: generate
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
- name: Cache R5 download
uses: actions/cache@v4
with:
path: downloads-r5
key: downloads-r5
- name: Generate R5
run: |
cp ./Default/settings.py .
sed -i "s|'../models|'models|g" settings.py
sed -i "s|'downloads'|'downloads-r5'|g" settings.py
sed -i "s|\(^specification_url = \)'.*'|\1'http://hl7.org/fhir/R5'|g" settings.py
rm -rf models
./generate.py
grep 'Generated from FHIR 5.0.0' models/account.py # sanity check
# FIXME: The R5 tests fail to pass currently (due to some wrong types and missing properties)
# See https://github.com/smart-on-fhir/fhir-parser/issues/51
# - name: Test R5
# run: |
# FHIR_UNITTEST_DATADIR=downloads-r5 pytest
- name: Cache R4 download
uses: actions/cache@v4
with:
path: downloads-r4
key: downloads-r4
- name: Generate R4
run: |
cp ./Default/settings.py .
sed -i "s|'../models|'models|g" settings.py
sed -i "s|'downloads'|'downloads-r4'|g" settings.py
sed -i "s|\(^specification_url = \)'.*'|\1'http://hl7.org/fhir/R4'|g" settings.py
rm -rf models
./generate.py
grep 'Generated from FHIR 4.0.1' models/account.py # sanity check
- name: Test R4
run: |
FHIR_UNITTEST_DATADIR=downloads-r4 pytest