-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (45 loc) · 1.39 KB
/
unit.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
name: unit test
on: [push, pull_request]
defaults:
run:
# This is needed for miniconda, see:
# https://github.com/marketplace/actions/setup-miniconda#important.
shell: bash -l {0}
jobs:
miniwdl_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install miniwdl
run: |
python -m pip install --upgrade pip
pip3 install miniwdl
pip3 install pytest-workflow
mkdir ~/temp
- name: Run unit tests
# Use --symlink to limit disk usage.
run: >-
pytest --keep-workflow-wd --git-aware
--symlink tests/ --basetemp ~/temp
- name: Check files
run: ls -ltr ~/temp/*
- name: Check miniwdl log in case of failure.
if: ${{ failure() }}
# Get the last 1000 lines of the miniwdl log to catch the error.
run: bash -c 'tail -n 1000 ~/temp/pytest_workflow_*/*/log.out'
- name: Check job stderr messages in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find ~/temp -name stderr);
do echo $file; cat $file; done'
- name: Check job stdout messages in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find ~/temp -name stdout);
do echo $file; cat $file; done'