-
Notifications
You must be signed in to change notification settings - Fork 35
59 lines (59 loc) · 1.79 KB
/
ci.yaml
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
name: CI
on:
push:
pull_request:
schedule:
- cron: "0 0 1 * *" # run monthly
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
modes: ["s", "p"]
schedulers: ["gridengine", "slurm"]
env:
REGISTRY: ghcr.io
NAME: ${{ matrix.schedulers }}-${{ matrix.modes }}
IMAGE: ${{ github.repository_owner }}/sv-callers-${{ matrix.schedulers }}
TAG: "1.2.2"
ARGS: 0 ${{ matrix.modes }} ${{ matrix.schedulers }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.7"
- name: Python info
run: |
which python
python --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test-requirements.txt
- name: Show pip list
run: pip list
- name: Run unit tests
run: |
pytest --cov=helper_functions --cov-report=xml
mv coverage.xml ${{ github.workspace }}
working-directory: workflow
- name: Log into registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run workflow
run: |
docker run -d -p 10000:22 --name $NAME ${REGISTRY}/${IMAGE,,}:${TAG}
sleep 10
docker ps -a
docker exec -u xenon -t $NAME bash -c "cd sv-callers && ./run.sh $ARGS"
- name: Upload coverage report to Codacy
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml