File: tests.yml

package info (click to toggle)
eagerpy 0.30.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 440 kB
  • sloc: python: 3,914; makefile: 73; javascript: 38; sh: 30
file content (87 lines) | stat: -rw-r--r-- 2,416 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Tests

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.6, 3.7]

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
        restore-keys: |
          ${{ runner.os }}-pip-
    - name: Install requirements-dev.txt
      run: |
        python -m pip install --upgrade pip setuptools
        pip install -r requirements-dev.txt
    - name: flake8
      run: |
        flake8 . --count --show-source --statistics
    - name: black
      run: |
        black --check --verbose .
    - name: Install package
      run: |
        pip install -e .
    - name: Install requirements.txt
      run: |
        function retry-with-backoff() {
          for BACKOFF in 0 1 2 4 8 16 32 64; do
            sleep $BACKOFF
            if "$@"; then
              return 0
            fi
          done
          return 1
        }
        retry-with-backoff pip install -r requirements.txt
    - name: mypy (package)
      run: |
        mypy -p eagerpy
    - name: mypy (tests)
      run: |
        mypy tests/
    - name: Test with pytest
      run: |
        pytest --cov-report term-missing --cov=eagerpy --verbose
    - name: Test with pytest (NumPy)
      run: |
        pytest --cov-report term-missing --cov=eagerpy --cov-append --verbose --backend numpy
    - name: Test with pytest (PyTorch)
      run: |
        pytest --cov-report term-missing --cov=eagerpy --cov-append --verbose --backend pytorch
    - name: Test with pytest (JAX)
      run: |
        pytest --cov-report term-missing --cov=eagerpy --cov-append --verbose --backend jax
    - name: Test with pytest (TensorFlow)
      run: |
        pytest --cov-report term-missing --cov=eagerpy --cov-append --verbose --backend tensorflow
    - name: Codecov
      continue-on-error: true
      env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
      run: |
        codecov
    - name: Coveralls
      continue-on-error: true
      env:
        COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
      run: |
        coveralls