updated CI #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ devel ] | |
pull_request: | |
branches: [ devel ] | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
python -m venv testenv | |
. testenv/bin/activate | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade . | |
python -m pip install -r requirements-tests.txt | |
- name: Lint with flake8 and pylint | |
run: | | |
. testenv/bin/activate | |
LOG=`git log -n 1 | grep Merge` | |
NEW=`echo $LOG | cut -d ' ' -f2` | |
OLD=`echo $LOG | cut -d ' ' -f3` | |
(test -z "$NEW" || test -z "$OLD") && echo 'nothing to lint' && exit 0 | |
DIFF=`git diff --name-only --diff-filter=db $NEW..$OLD` | |
FILTERED=$(for f in $DIFF; do echo $f; done | \ | |
grep -e '\.py$' | sed "s|^|$PWD/|") | |
test -z "$FILTERED" && echo 'nothing to lint' && exit 0 | |
flake8 $FILTERED | |
pylint $FILTERED | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m venv testenv | |
. testenv/bin/activate | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade . | |
python -m pip install git+https://github.com/radical-cybertools/radical.saga.git@devel | |
python -m pip install git+https://github.com/radical-cybertools/radical.pilot.git@devel | |
python -m pip install -r requirements-tests.txt | |
- name: Test with pytest | |
env: | |
RADICAL_DEBUG: TRUE | |
RADICAL_DEBUG_HELPER: TRUE | |
LOC: testenv/lib/python${{ matrix.python-version }}/site-packages | |
run: | | |
. testenv/bin/activate | |
radical-stack | |
coverage run --include=$LOC/radical/utils/* -m pytest -ra -vvv --showlocals tests/unittests/ | |
coverage xml | |
- uses: codecov/codecov-action@v3 | |
if: ${{ matrix.python-version == '3.7' }} | |
with: | |
files: ./coverage.xml | |