Skip to content

Commit

Permalink
fix(ci): prune duplicated tests/checks (#333)
Browse files Browse the repository at this point in the history
* prune duplicated tests
* testing-guardian
  • Loading branch information
Borda authored Aug 15, 2024
1 parent 36049a8 commit a39f31c
Showing 1 changed file with 18 additions and 27 deletions.
45 changes: 18 additions & 27 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ defaults:
shell: bash

jobs:
pytest:
pytester:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
python-version: [3.9]
requires: ["oldest", "latest"]
os: ["ubuntu-latest", "macos-13", "windows-latest"]
python-version: ["3.9"]

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 35
Expand All @@ -34,20 +33,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# Github Actions: Run step on specific OS: https://stackoverflow.com/a/57948488/4521646
#- name: Setup macOS
# if: runner.os == 'macOS'
# run: |
# brew install libomp # https://github.com/pytorch/pytorch/issues/20030

- name: Set min. dependencies
if: matrix.requires == 'oldest'
run: |
for fpath in ('requirements.txt', 'requirements/test.txt'):
req = open(fpath).read().replace('>=', '==')
open(fpath, 'w').write(req)
shell: python

- name: Display dependencies
run: |
cat requirements.txt
Expand All @@ -64,18 +49,10 @@ jobs:
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-

- name: Install package & dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
pip --version
pip install -e '.[extras]' -r requirements/test.txt -U -q --find-links $TORCH_URL
pip list
- name: Install package & dependencies
if: matrix.os != 'ubuntu-latest'
run: |
pip --version
pip install -e . -r requirements/test.txt -U -q --find-links $TORCH_URL
pip install -e ".[extras]" -r requirements/test.txt -U -q --find-links $TORCH_URL
pip list
- name: Tests
Expand All @@ -96,3 +73,17 @@ jobs:
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false

testing-guardian:
runs-on: ubuntu-latest
needs: pytester
if: always()
steps:
- run: echo "${{ needs.pytester.result }}"
- name: failing...
if: needs.pytester.result == 'failure'
run: exit 1
- name: cancelled or skipped...
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result)
timeout-minutes: 1
run: sleep 90

0 comments on commit a39f31c

Please sign in to comment.