-
Notifications
You must be signed in to change notification settings - Fork 23
122 lines (110 loc) · 3.42 KB
/
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
name: Tests
on:
pull_request:
push:
branches: [main]
jobs:
test:
name: Python
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [3.8, 3.9]
os: [macos-latest, ubuntu-latest, windows-latest]
sys: [mingw64, ucrt64]
env: [x86_64, ucrt-x86_64]
exclude:
- os: macos-latest
sys: ucrt64
- os: macos-latest
sys: mingw64
env: ucrt-x86_64
- os: ubuntu-latest
sys: ucrt64
- os: ubuntu-latest
sys: mingw64
env: ucrt-x86_64
- os: windows-latest
sys: ucrt64
env: x86_64
- os: windows-latest
sys: mingw64
env: ucrt-x86_64
defaults:
run:
shell: bash -l {0}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2
- name: Install Conda
uses: mamba-org/provision-with-micromamba@main
with:
environment-name: anaconda-client-env
environment-file: requirements/CI-conda/ci-environment.yml
cache-env: true
extra-specs: |
python=${{ matrix.python }}
- name: Setup MSYS2 ${{matrix.sys}}
uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
msystem: ${{matrix.sys}}
release: false
install: >-
git
base-devel
msys2-devel
mingw-w64-${{matrix.env}}-zstd
mingw-w64-${{matrix.env}}-zlib
mingw-w64-${{matrix.env}}-toolchain
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-autotools
- name: Cache SLiM build
if: matrix.os == 'windows-latest'
id: cache-slim
uses: actions/cache@v3.0.5 # latest version is broken https://github.com/actions/cache/issues/891, so pinning to 3.0.5
with:
path: D:\a\pyslim\pyslim\SLiM
key: ${{runner.os}}-${{matrix.sys}}-${{matrix.env}}-key
- name: Build SLiM windows
if: ( matrix.os == 'windows-latest' && steps.cache-slim.outputs.cache-hit != 'true' )
shell: msys2 {0}
run: |
git clone https://github.com/messerlab/SLiM.git
mkdir -p SLiM/Release
cd SLiM/windows_compat/gnulib
touch --date="`date`" aclocal.m4 Makefile.am configure configure.ac config.h.in Makefile.in
cd ../..
cd Release
cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j 2
- name: Install SLiM macos / linux
if: (matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest')
run: |
micromamba install slim -y
- name: Run tests
shell: bash -l {0}
run: |
micromamba info
micromamba list
export PATH=$PWD/SLiM/Release:$PATH
which slim
slim -v
python -m pytest \
-n 0 \
-v \
--cov=pyslim \
--cov-branch \
--cov-report=term-missing \
--cov-report=xml \
tests
- name: upload coverage report to codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
env_vars: OS,PYTHON
token: ${{ secrets.CODECOV_TOKEN }}