-
-
Notifications
You must be signed in to change notification settings - Fork 62
206 lines (173 loc) · 5.62 KB
/
ci-tests.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Continuous integration tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
tox:
name: CI tests via Tox
runs-on: ubuntu-22.04
strategy:
matrix:
py-ver-major: [3]
py-ver-minor: [8, 9, 10, 11, 12]
step: [lint, unit, mypy, memleak]
env:
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
TOXENV: ${{ format('py{0}{1}-{2}', matrix.py-ver-major, matrix.py-ver-minor, matrix.step) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.py-semver }}
cache: pip
cache-dependency-path: |
requirements.txt
tox.ini
- name: Upgrade setuptools and install tox
run: |
pip install -U pip setuptools wheel
pip install 'tox<4' tox-gh-actions
- name: MyPy cache
if: ${{ matrix.step == 'mypy' }}
uses: actions/cache@v4
with:
path: .mypy_cache/${{ env.py-semver }}
key: mypy-${{ env.py-semver }}
- name: Test with tox
run: tox
- name: Upload coverage to Codecov
if: ${{ matrix.step == 'unit' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
tox-style:
name: CI linters via Tox
runs-on: ubuntu-20.04
strategy:
matrix:
step: [lintreadme, pydocstyle]
env:
py-semver: "3.12"
TOXENV: ${{ format('py312-{0}', matrix.step) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.py-semver }}
- name: Cache for pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.step }}-${{ hashFiles('requirements.txt') }}
- name: Upgrade setuptools and install tox
run: |
pip install -U pip setuptools wheel
pip install 'tox<4' tox-gh-actions
- if: ${{ matrix.step == 'pydocstyle' && github.event_name == 'pull_request'}}
name: Create local branch for diff-quality for PRs
run: git branch ${{github.base_ref}} origin/${{github.base_ref}}
- name: Test with tox
run: tox
typescript:
name: Confirm that codegen typescript passes tests with CWL
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: |
requirements.txt
tox.ini
- name: Upgrade setuptools and install schema-salad
run: |
pip install -U pip setuptools wheel
pip install .
- name: Download valid CWL documents for testing
run: |
wget "https://github.com/common-workflow-lab/cwl-ts-auto/archive/refs/heads/main.zip"
unzip main.zip
- name: Generate cwl-ts-auto
run: |
schema-salad-tool --codegen typescript --codegen-examples cwl-ts-auto-main/src/test/data/examples \
--codegen-target cwl-ts-auto \
https://github.com/common-workflow-language/cwl-v1.2/raw/codegen/CommonWorkflowLanguage.yml
- name: run cwl-ts-auto tests
run: |
cd cwl-ts-auto
npm install
npm test
cpp:
name: Confirm that codegen C++ passes tests with CWL
runs-on: ubuntu-22.04
steps:
- name: Install C++ dependencies
run: sudo apt-get install libyaml-cpp-dev
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: |
requirements.txt
tox.ini
- name: Upgrade setuptools and install schema-salad
run: |
pip install -U pip setuptools wheel
pip install .
- name: Download cwl-cpp-auto for its tests
run: |
wget "https://github.com/common-workflow-lab/cwl-cpp-auto/archive/refs/heads/main.zip"
unzip main.zip
- name: Generate cwl-cpp-auto and run tests
run: |
cd cwl-cpp-auto-main
make cwl_v1_2.h tests CXXFLAGS=-std=c++17
release_test:
name: Schema Salad release test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Cache for pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-release-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
- name: Install packages
run: |
pip install -U pip setuptools wheel
pip install virtualenv
- name: Release test
env:
RELEASE_SKIP: head
run: ./release-test.sh
build_test_container:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: record schema-salad version
run: pip install -U setuptools wheel && pip install setuptools_scm[toml] && python setup.py --version
- name: build & test schema_salad container
run: ./build-schema_salad-docker.sh