-
Notifications
You must be signed in to change notification settings - Fork 18
184 lines (152 loc) · 4.61 KB
/
main.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
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
name: main
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check-branch:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 2
concurrency:
group: check-pr-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if the PR's branch is updated
uses: osl-incubator/gh-check-pr-is-updated@1.0.0
with:
remote_branch: origin/main
pr_sha: ${{ github.event.pull_request.head.sha }}
tests:
strategy:
matrix:
os:
- "ubuntu"
- "macos"
- "windows"
runs-on: ${{ matrix.os }}-latest
concurrency:
group: ci-main-tests-${{ matrix.os }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Cache Conda packages
uses: actions/cache@v4
with:
path: ~/.conda/pkgs
key: conda-${{ runner.os }}-${{ hashFiles('**/conda*.yaml') }}
restore-keys: |
conda-${{ runner.os }}-
- name: Install dependencies with conda for linux/macos
uses: conda-incubator/setup-miniconda@v3
if: ${{ matrix.os != 'windows' }}
with:
miniforge-version: latest
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: scicookie
auto-update-conda: true
conda-solver: libmamba
- name: Install dependencies with conda for windows
uses: conda-incubator/setup-miniconda@v3
if: ${{ matrix.os == 'windows' }}
with:
miniforge-version: latest
environment-file: conda/dev-win.yaml
channels: conda-forge,nodefaults
activate-environment: scicookie
auto-update-conda: true
conda-solver: libmamba
- name: Check poetry.lock
run: poetry check
- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry install
- name: Run tests
if: ${{ matrix.os != 'windows' }}
run: makim tests.unittest
- name: Run tests
if: ${{ matrix.os == 'windows' }}
run: pytest -s -vv --template src/scicookie tests
# - name: Semantic Release PR Title Check
# uses: osl-incubator/semantic-release-pr-title-check@v1.4.3
# if: success() || failure()
# with:
# convention-name: conventionalcommits
linter:
runs-on: ubuntu-latest
concurrency:
group: ci-main-linter-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Cache Conda packages
uses: actions/cache@v4
with:
path: ~/.conda/pkgs
key: conda-${{ runner.os }}-${{ hashFiles('**/conda*.yaml') }}
restore-keys: |
conda-${{ runner.os }}-
- name: Install dependencies with conda for linux/macos
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: scicookie
auto-update-conda: true
conda-solver: libmamba
- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry install
- name: Run style checks
run: |
pre-commit install
makim tests.lint
smoke-test:
runs-on: ubuntu-latest
concurrency:
group: ci-main-smoke-${{ matrix.smoke_file }}-${{ github.ref }}
cancel-in-progress: true
strategy:
matrix:
smoke_file:
- automation.sh
- auto-format-tools.sh
- build-systems.sh
- containers.sh
- docs.sh
- files.sh
- linters.sh
- tests.sh
- virtual-envs.sh
- cli.sh
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: scicookie
auto-update-conda: true
conda-solver: libmamba
- name: Install dependencies
run: poetry install
- name: Run Smoke Test (${{ matrix.smoke_file }})
run: bash ./tests/smoke/${{ matrix.smoke_file }}