-
Notifications
You must be signed in to change notification settings - Fork 212
105 lines (103 loc) · 3.04 KB
/
test.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
name: Test
on: [push, pull_request]
defaults:
run:
shell: bash -l {0}
jobs:
check_versions_matches:
name: Check deeptools version matches galaxy tools
runs-on: ubuntu-latest
if: github.base_ref == 'master'
steps:
- uses: actions/checkout@v4
- name: Check path
run: find /home/runner/work/deepTools/deepTools -name "pyproject.toml"
- name: Get Version of Deeptools
run: echo "deeptools_version=$(grep "version" /home/runner/work/deepTools/deepTools/pyproject.toml | awk '{print substr($NF, 2, length($NF) - 2)}')" >> $GITHUB_ENV
- name: Get Version of Galaxy tools
run: echo "galaxy_deeptools_version=$(grep "token.*TOOL_VERSION" /home/runner/work/deepTools/deepTools/galaxy/wrapper/deepTools_macros.xml | awk -F '>|<' '{print $3}')" >> $GITHUB_ENV
- name: Versions
run: |
echo deeptools version=${deeptools_version}
echo deeptools version in galaxy=${galaxy_deeptools_version}
- name: Fail PR if versions not matching
run: |
if [ -z $galaxy_deeptools_version ]; then
echo "galaxy_deeptools_version not defined change the github action"
exit 1
fi
if [ -z $deeptools_version ]; then
echo "deeptools_version not defined change the github action"
exit 1
fi
if [ "$galaxy_deeptools_version" != "$deeptools_version" ]; then
echo "versions do not match"
exit 1
fi
build-linux:
name: Test on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: pip install
run: |
pip install .[actions]
- name: PEP8
run: |
micromamba activate test_and_build
flake8 . --exclude=.venv,.build,build --ignore=E501,F403,E402,F999,F405,E722,W504,W605
- name: Test deepTools
run: |
pytest -v
- name: make an artifact
run: |
rm -f dist/*
python -m build
- uses: actions/upload-artifact@v4
with:
name: "distfiles"
path: "dist"
test-wheels:
name: test wheel
runs-on: ubuntu-latest
needs: build-linux
strategy:
matrix:
python-version: ['3.9','3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: "distfiles"
path: ~/dist/
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: install wheel
run: |
pip install ~/dist/*whl
deeptools -h
- name: pytest
run: |
pip install pytest
pytest -v
build-osx:
name: Test on OSX
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: pip install
run: |
pip install .[actions]
- name: Test deepTools
run: |
pytest -v