-
Notifications
You must be signed in to change notification settings - Fork 56
65 lines (61 loc) · 2.05 KB
/
build.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
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y libxml2-utils pandoc
sudo wget -O /usr/bin/bedtools https://github.com/arq5x/bedtools2/releases/download/v2.30.0/bedtools.static.binary
sudo chmod +x /usr/bin/bedtools
pip install --upgrade pip flit flake8
flit install -s
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 scglue --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Test with pytest
run: |
pytest --cov="scglue" --cov-report="xml:cov.xml" tests --cpu-only
COVERAGE=$(xmllint --xpath "/coverage/@line-rate" cov.xml | awk -F\" '{cov = sprintf("%.0f%%", $2 * 100); print(cov);}')
echo "COVERAGE=${COVERAGE}" >> $GITHUB_ENV
- name: Create coverage badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ secrets.GIST_ID }}
filename: coverage.json
label: coverage
message: ${{ env.COVERAGE }}
color: green
- name: Build documentation
run: |
sphinx-build -b html docs docs/_build
- name: Get version
run: |
VERSION=$(python -c "from scglue import __version__; print(__version__)")
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Create version badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ secrets.GIST_ID }}
filename: version.json
label: version
message: ${{ env.VERSION }}
color: blue