-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
115 additions
and
120 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: Test | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
mode: [tests] | ||
python: | ||
- "2.7" | ||
- "3.5" | ||
include: | ||
- os: ubuntu-latest | ||
mode: coverage | ||
python: "3.8" | ||
- os: ubuntu-latest | ||
mode: checks | ||
python: "3.8" | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
TEST_MODE: ${{ matrix.mode }} | ||
REPROZIP_USAGE_STATS: "off" | ||
REPROZIP_PARAMETERS: https://stats.reprozip.org/parameters/travis/ | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install dependencies | ||
run: | | ||
if [ -z "${XDG_CACHE_HOME-}" ]; then | ||
mkdir -p ~/.cache/reprozip | ||
else | ||
mkdir -p "$XDG_CACHE_HOME/reprozip" | ||
fi | ||
case "$TEST_MODE" | ||
in | ||
tests|coverage) | ||
if [ "$TEST_MODE" = "coverage" ]; then | ||
export CFLAGS="-fprofile-arcs -ftest-coverage" | ||
fi | ||
sudo apt-get update -qq | ||
sudo apt-get install -qq libc6-dev-i386 gcc-multilib libsqlite3-dev | ||
if [ $TEST_MODE = "coverage" ]; then | ||
pip install 'coverage<5' codecov | ||
pip install -e ./reprozip -e ./reprounzip -e ./reprounzip-docker -e ./reprounzip-vagrant -e ./reprounzip-vistrails -e ./reprounzip-qt -e ./reprozip-jupyter | ||
else | ||
pip install ./reprozip ./reprounzip ./reprounzip-docker ./reprounzip-vagrant ./reprounzip-vistrails ./reprounzip-qt -e ./reprozip-jupyter | ||
fi | ||
;; | ||
checks) | ||
pip install flake8 readme_renderer | ||
;; | ||
*) | ||
exit 1 | ||
;; | ||
esac | ||
- name: Test | ||
run: | | ||
export LANG=C | ||
export LC_ALL=C | ||
case "$TEST_MODE" | ||
in | ||
tests|coverage) | ||
export PYTHONUNBUFFERED=1 | ||
if [ "$TEST_MODE" = "coverage" ]; then | ||
export COVER="coverage run --append --source=$PWD/reprozip/reprozip,$PWD/reprounzip/reprounzip,$PWD/reprounzip-docker/reprounzip,$PWD/reprounzip-vagrant/reprounzip,$PWD/reprounzip-vistrails/reprounzip --branch" | ||
fi | ||
python tests --run-docker | ||
;; | ||
checks) | ||
flake8 --ignore=E731,W504 | ||
find scripts -name '*.py' -exec flake8 {} + | ||
diff -q reprozip/reprozip/common.py reprounzip/reprounzip/common.py | ||
diff -q reprozip/reprozip/utils.py reprounzip/reprounzip/utils.py | ||
find reprozip reprounzip reprozip-* reprounzip-* .travis -name '*.py' -or -name '*.sh' -or -name '*.h' -or -name '*.c' | (set +x; while read i; do | ||
T=$(file -b --mime "$i") | ||
if ! ( echo "$T" | grep -q ascii || echo "$T" | grep -q empty ) ; then | ||
echo "$i is not ASCII" | ||
exit 1 | ||
fi | ||
done) | ||
find reprozip reprounzip reprozip-* reprounzip-* -name '*.py' -exec sh -c "grep 'logging\\.\\(debug\\|warning\\|critical\\|error\\|info\\)' \"\$@\" && exit 1; exit 0" {} + | ||
for pkg in reprozip reprounzip reprozip-* reprounzip-*; do | ||
(cd $pkg && python setup.py check -r -s) | ||
done | ||
;; | ||
*) | ||
exit 1 | ||
;; | ||
esac | ||
- name: Upload coverage | ||
if: matrix.mode == 'coverage' | ||
run: | | ||
# Python | ||
if [ -f .coverage ]; then mv .coverage .coverage.orig; fi # FIXME: useless? | ||
coverage combine | ||
codecov | ||
# C | ||
# Find the coverage file (in distutils's build directory) | ||
OBJDIR=$(dirname "$(find . -name pytracer.gcno | head -n 1)") | ||
(cd reprozip/native && gcov -o ../../$OBJDIR *.c) | ||
curl -s -o - https://codecov.io/bash | bash - |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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