Skip to content

chore(CI): Run workflow on PRs #225

chore(CI): Run workflow on PRs

chore(CI): Run workflow on PRs #225

Workflow file for this run

name: CapCruncher CI
on:
push:
pull_request:
branches: [master, develop]
env:
CACHE_NUMBER: 1
jobs:
install-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
# - name: Install Mac dependencies
# if: matrix.os == 'macos-latest'
# run: |
# brew install curl-openssl coreutils
- name: Restore bowtie2 cache
uses: actions/cache@v3
with:
path: tests/data/data_for_pipeline_run/chr14_bowtie2_indicies/*.bt2
key: ${{ env.CACHE_NUMBER }}
id: bowtie2_cache
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: test
use-mamba: true
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER}}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache-conda-env
- name: Update environment
run: mamba env update -n test -f environment.yml
if: steps.cache-conda-env.outputs.cache-hit != 'true'
- name: Check installed packages
shell: bash -el {0}
run: |
mamba info
- name: Install the package
shell: bash -el {0}
run: |
pip install .[full]
- name: Test with pytest and generate report
shell: bash -el {0}
run: |
pip install pytest-cov pytest-lazy-fixture pytest-order pytest-xdist
pytest -vv -s --log-cli-level info --cov=./ --cov-report=xml --cores 2
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true
files: ./coverage.xml
verbose: true