-
-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (51 loc) · 1.64 KB
/
run-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
# This workflows will create a new demo repository using The Hatchlor for demonstration purposes
name: Run tests
on:
push:
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
cookiecutter_cfg: ['default.yml', 'lock-file.yml', 'proprietary.yml']
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
path: ./hatchlor-template
- name: Setup Python environment
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: ./hatchlor-template/.github/test_environment.yml
init-shell: >-
bash
powershell
cache-environment: true
post-cleanup: 'all'
- name: Setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
- name: Run cookiecutter
run: cookiecutter --no-input ./hatchlor-template --config-file ./hatchlor-template/configs/${{ matrix.cookiecutter_cfg }}
- name: Test some general hatch commands
working-directory: ./hatchlor-demo
run: |
hatch run fibonacci 10
hatch run test:cov
hatch run lint:all
hatch run pre-commit run --all-files
- name: Build the package
working-directory: ./hatchlor-demo
run: hatch build
- name: Test lock-file related commands
if: matrix.cookiecutter_cfg == 'lock-file.yml'
working-directory: ./hatchlor-demo
run: |
hatch run upgrade-all
hatch run test:upgrade-all
hatch run test:upgrade-pkg pytest