Skip to content

Commit

Permalink
Merge pull request #381 from radical-cybertools/fix/ci
Browse files Browse the repository at this point in the history
updated CI
  • Loading branch information
mtitov authored Apr 30, 2024
2 parents d15879f + 14e0ef3 commit 755165a
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 95 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

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 -r requirements-ci.txt
- name: Lint with flake8 and pylint
run: |
. testenv/bin/activate
radical-stack
LOG=`git log -n 1 | grep Merge` || echo 'no merging' && exit 0
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 -r requirements-ci.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' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml

84 changes: 0 additions & 84 deletions .github/workflows/python-app.yml

This file was deleted.

20 changes: 20 additions & 0 deletions requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# provided branches for RCT components can be edited,
# if there is a dependency with non-devel branch

# default RCT branch for CI runs is "devel"

radical.saga @ git+https://github.com/radical-cybertools/radical.saga@devel
radical.pilot @ git+https://github.com/radical-cybertools/radical.pilot@devel

# RP from the current branch
.

pytest
pytest-timeout
pylint
flake8
flake8-per-file-ignores
coverage
pudb

10 changes: 0 additions & 10 deletions requirements-tests.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

colorama
msgpack
netifaces
Expand Down

0 comments on commit 755165a

Please sign in to comment.