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