Skip to content

DOC: Add .readthedocs.yaml which is now required #451

DOC: Add .readthedocs.yaml which is now required

DOC: Add .readthedocs.yaml which is now required #451

Workflow file for this run

name: Test
on:
- push
- pull_request
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
mode: [tests]
python:
- "3.11"
include:
- os: ubuntu-latest
mode: coverage
python: "3.8"
- os: ubuntu-20.04
mode: tests
python: "3.5"
- os: ubuntu-latest
mode: checks
python: "3.8"
- os: ubuntu-latest
mode: check-images
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@v3
with:
fetch-depth: 20
- uses: actions/setup-python@v4
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|check-images)
if [ "$TEST_MODE" = "coverage" ]; then
export CFLAGS="-fprofile-arcs -ftest-coverage"
fi
PKGS="libc6-dev-i386 gcc-multilib libsqlite3-dev"
if [ "$TEST_MODE" = "coverage" ]; then PKGS="$PKGS lcov"; fi
sudo apt-get update -qq
sudo apt-get install -qq $PKGS
if [ $TEST_MODE = "coverage" ]; then
pip install 'coverage<5'
# `--config-settings editable_mode=compat` works around https://github.com/pypa/setuptools/issues/3557
pip install -e ./reprozip -e ./reprounzip -e ./reprounzip-docker -e ./reprounzip-vagrant -e ./reprounzip-vistrails -e ./reprounzip-qt -e ./reprozip-jupyter --config-settings editable_mode=compat
else
pip install ./reprozip ./reprounzip ./reprounzip-docker ./reprounzip-vagrant ./reprounzip-vistrails ./reprounzip-qt ./reprozip-jupyter
fi
;;
checks)
pip install flake8 readme_renderer
;;
*)
exit 1
;;
esac
- name: Test
run: |
export LANG=C
export LC_ALL=C
export REPROZIP_TEST_PYTHON="$(which python) -Wd"
case "$TEST_MODE"
in
coverage)
export PYTHONUNBUFFERED=1
export COVER="coverage run --append --source=$PWD/reprozip/reprozip,$PWD/reprounzip/reprounzip,$PWD/reprounzip-docker/reprounzip,$PWD/reprounzip-vagrant/reprounzip,$PWD/reprounzip-vistrails/reprounzip,$PWD/tests --branch"
python -Wd -m $COVER -m tests --run-docker
;;
tests)
export PYTHONUNBUFFERED=1
python -Wd tests --run-docker
;;
check-images)
python -Wd tests --check-vagrant-images --check-docker-images
;;
checks)
flake8 --ignore=E731,W503,W504
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-* -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
# C
# Find the coverage file (in distutils's build directory)
OBJDIR=$(dirname "$(find . -name pytracer.gcno | head -n 1)")
(cd reprozip/native && lcov --directory ../../$OBJDIR -c -o reprozip.lcov)
curl -s -o - https://codecov.io/bash | bash -s - -X gcov
test-container:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python:
- "2.7"
runs-on: ${{ matrix.os }}
container:
image: python:${{ matrix.python }}
options: "--privileged"
env:
TEST_MODE: tests
REPROZIP_USAGE_STATS: "off"
REPROZIP_PARAMETERS: https://stats.reprozip.org/parameters/travis/
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 20
- name: Install Docker client
run: |
curl -Lo /tmp/docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-23.0.6.tgz
tar -xf /tmp/docker.tgz -C /usr/local/bin --strip-components=1
rm /tmp/docker.tgz
- name: Install dependencies
run: |
if [ -z "${XDG_CACHE_HOME-}" ]; then
mkdir -p ~/.cache/reprozip
else
mkdir -p "$XDG_CACHE_HOME/reprozip"
fi
apt-get update -qq
apt-get install -qq libc6-dev-i386 gcc-multilib libsqlite3-dev
cat > pip.constraints.txt <<'EOF'
pyelftools<0.30
EOF
pip install -c pip.constraints.txt ./reprozip ./reprounzip ./reprounzip-docker ./reprounzip-vagrant ./reprounzip-vistrails ./reprounzip-qt ./reprozip-jupyter
- name: Test
run: |
export LANG=C
export LC_ALL=C
export REPROZIP_TEST_PYTHON="$(which python) -Wd"
export PYTHONUNBUFFERED=1
python -Wd tests --run-docker