From a39f31cec67cec6bfd2bfde2cb257ea242511a7e Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:35:23 +0200 Subject: [PATCH] fix(ci): prune duplicated tests/checks (#333) * prune duplicated tests * testing-guardian --- .github/workflows/ci-testing.yml | 45 +++++++++++++------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 080e70b5..31776090 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -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 @@ -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 @@ -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 @@ -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