Skip to content

CI

CI #122

Workflow file for this run

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