|
5 | 5 | - pull_request
|
6 | 6 |
|
7 | 7 | jobs:
|
8 |
| - test: |
9 |
| - strategy: |
10 |
| - fail-fast: false |
11 |
| - matrix: |
12 |
| - os: [ubuntu-latest] |
13 |
| - mode: [tests] |
14 |
| - python: |
15 |
| - - "3.11" |
16 |
| - include: |
17 |
| - - os: ubuntu-latest |
18 |
| - mode: coverage |
19 |
| - python: "3.8" |
20 |
| - - os: ubuntu-20.04 |
21 |
| - mode: tests |
22 |
| - python: "3.5" |
23 |
| - - os: ubuntu-latest |
24 |
| - mode: checks |
25 |
| - python: "3.8" |
26 |
| - - os: ubuntu-latest |
27 |
| - mode: check-images |
28 |
| - python: "3.8" |
29 |
| - runs-on: ${{ matrix.os }} |
30 |
| - env: |
31 |
| - TEST_MODE: ${{ matrix.mode }} |
32 |
| - REPROZIP_USAGE_STATS: "off" |
33 |
| - REPROZIP_PARAMETERS: https://stats.reprozip.org/parameters/travis/ |
34 |
| - steps: |
35 |
| - - uses: actions/checkout@v4 |
36 |
| - with: |
37 |
| - fetch-depth: 20 |
38 |
| - - uses: actions/setup-python@v5 |
39 |
| - with: |
40 |
| - python-version: ${{ matrix.python }} |
41 |
| - - name: Install dependencies |
42 |
| - run: | |
43 |
| - if [ -z "${XDG_CACHE_HOME-}" ]; then |
44 |
| - mkdir -p ~/.cache/reprozip |
45 |
| - else |
46 |
| - mkdir -p "$XDG_CACHE_HOME/reprozip" |
47 |
| - fi |
48 |
| -
|
49 |
| - case "$TEST_MODE" |
50 |
| - in |
51 |
| - tests|coverage|check-images) |
52 |
| - if [ "$TEST_MODE" = "coverage" ]; then |
53 |
| - export CFLAGS="-fprofile-arcs -ftest-coverage" |
54 |
| - fi |
55 |
| - PKGS="libc6-dev-i386 gcc-multilib libsqlite3-dev" |
56 |
| - if [ "$TEST_MODE" = "coverage" ]; then PKGS="$PKGS lcov"; fi |
57 |
| - sudo apt-get update -qq |
58 |
| - sudo apt-get install -qq $PKGS |
59 |
| - if [ $TEST_MODE = "coverage" ]; then |
60 |
| - pip install 'coverage<5' |
61 |
| - # `--config-settings editable_mode=compat` works around https://github.com/pypa/setuptools/issues/3557 |
62 |
| - 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 |
63 |
| - else |
64 |
| - pip install ./reprozip ./reprounzip ./reprounzip-docker ./reprounzip-vagrant ./reprounzip-vistrails ./reprounzip-qt ./reprozip-jupyter |
65 |
| - fi |
66 |
| - ;; |
67 |
| - checks) |
68 |
| - pip install flake8 readme_renderer |
69 |
| - ;; |
70 |
| - *) |
71 |
| - exit 1 |
72 |
| - ;; |
73 |
| - esac |
74 |
| - - name: Test |
75 |
| - run: | |
76 |
| - export LANG=C |
77 |
| - export LC_ALL=C |
78 |
| - export REPROZIP_TEST_PYTHON="$(which python) -Wd" |
79 |
| - case "$TEST_MODE" |
80 |
| - in |
81 |
| - coverage) |
82 |
| - export PYTHONUNBUFFERED=1 |
83 |
| - 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" |
84 |
| - python -Wd -m $COVER -m tests --run-docker |
85 |
| - ;; |
86 |
| - tests) |
87 |
| - export PYTHONUNBUFFERED=1 |
88 |
| - python -Wd tests --run-docker |
89 |
| - ;; |
90 |
| - check-images) |
91 |
| - python -Wd tests --check-vagrant-images --check-docker-images |
92 |
| - ;; |
93 |
| - checks) |
94 |
| - flake8 --ignore=E731,W503,W504 |
95 |
| - diff -q reprozip/reprozip/common.py reprounzip/reprounzip/common.py |
96 |
| - diff -q reprozip/reprozip/utils.py reprounzip/reprounzip/utils.py |
97 |
| - find reprozip reprounzip reprozip-* reprounzip-* -name '*.py' -or -name '*.sh' -or -name '*.h' -or -name '*.c' | (set +x; while read i; do |
98 |
| - T=$(file -b --mime "$i") |
99 |
| - if ! ( echo "$T" | grep -q ascii || echo "$T" | grep -q empty ) ; then |
100 |
| - echo "$i is not ASCII" |
101 |
| - exit 1 |
102 |
| - fi |
103 |
| - done) |
104 |
| - find reprozip reprounzip reprozip-* reprounzip-* -name '*.py' -exec sh -c "grep 'logging\\.\\(debug\\|warning\\|critical\\|error\\|info\\)' \"\$@\" && exit 1; exit 0" {} + |
105 |
| - for pkg in reprozip reprounzip reprozip-* reprounzip-*; do |
106 |
| - (cd $pkg && python setup.py check -r -s) |
107 |
| - done |
108 |
| - ;; |
109 |
| - *) |
110 |
| - exit 1 |
111 |
| - ;; |
112 |
| - esac |
113 |
| - - name: Upload coverage |
114 |
| - if: matrix.mode == 'coverage' |
115 |
| - run: | |
116 |
| - # Python |
117 |
| - if [ -f .coverage ]; then mv .coverage .coverage.orig; fi # FIXME: useless? |
118 |
| - coverage combine |
119 |
| -
|
120 |
| - # C |
121 |
| - # Find the coverage file (in distutils's build directory) |
122 |
| - OBJDIR=$(dirname "$(find . -name pytracer.gcno | head -n 1)") |
123 |
| - (cd reprozip/native && lcov --directory ../../$OBJDIR -c -o reprozip.lcov) |
124 |
| -
|
125 |
| - curl -s -o - https://codecov.io/bash | bash -s - -X gcov |
126 |
| -
|
127 | 8 | test-container:
|
128 | 9 | strategy:
|
129 | 10 | fail-fast: false
|
|
0 commit comments