Skip to content

Commit

Permalink
Only continue tests.yml workflow if not canceled (#5018)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard authored Sep 29, 2023
1 parent 5d72312 commit a6279ee
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ jobs:
flags: ${{ matrix.test-type }},${{ matrix.python-version }},linux-64

- name: Tar Allure Results
if: always()
if: '!cancelled()'
run: tar -zcf "${{ env.ALLURE_DIR }}.tar.gz" "${{ env.ALLURE_DIR }}"

- name: Upload Allure Results
if: always()
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: allure-Linux-${{ matrix.conda-version }}-Py${{ matrix.python-version }}-${{ matrix.test-type }}
path: allure-results.tar.gz

- name: Upload Pytest Replay
if: always()
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: ${{ env.REPLAY_NAME }}-${{ matrix.test-type }}
Expand Down Expand Up @@ -250,21 +250,21 @@ jobs:
flags: ${{ matrix.test-type }},${{ matrix.python-version }},win-64

- name: Tar Allure Results
if: always()
if: '!cancelled()'
run: tar -zcf "${{ env.ALLURE_DIR }}.tar.gz" "${{ env.ALLURE_DIR }}"
# windows-2019/powershell ships with GNU tar 1.28 which struggles with Windows paths
# window-2019/cmd ships with bsdtar 3.5.2 which doesn't have this problem
shell: cmd

- name: Upload Allure Results
if: always()
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: allure-Win-${{ matrix.conda-version }}-Py${{ matrix.python-version }}-${{ matrix.test-type }}
path: allure-results.tar.gz

- name: Upload Pytest Replay
if: always()
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
path: ${{ env.REPLAY_DIR }}
Expand Down Expand Up @@ -361,18 +361,18 @@ jobs:
flags: ${{ matrix.test-type }},${{ matrix.python-version }},osx-64

- name: Tar Allure Results
if: always()
if: '!cancelled()'
run: tar -zcf "${{ env.ALLURE_DIR }}.tar.gz" "${{ env.ALLURE_DIR }}"

- name: Upload Allure Results
if: always()
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: allure-macOS-${{ matrix.conda-version }}-Py${{ matrix.python-version }}-${{ matrix.test-type }}
path: allure-results.tar.gz

- name: Upload Pytest Replay
if: always()
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: ${{ env.REPLAY_NAME }}-${{ matrix.test-type }}
Expand All @@ -382,7 +382,12 @@ jobs:
aggregate:
# only aggregate test suite if there are code changes
needs: [changes, linux, windows, macos]
if: always() && (github.event_name == 'schedule' || needs.changes.outputs.code == 'true')
if: >-
!cancelled()
&& (
github.event_name == 'schedule'
|| needs.changes.outputs.code == 'true'
)
runs-on: ubuntu-latest
steps:
Expand All @@ -407,7 +412,7 @@ jobs:
analyze:
name: Analyze results
needs: [linux, windows, macos, aggregate]
if: always()
if: '!cancelled()'

runs-on: ubuntu-latest
steps:
Expand All @@ -426,7 +431,7 @@ jobs:
# - this is the main repo, and
# - we are on the main, feature, or release branch
if: >-
always()
!cancelled()
&& !github.event.repository.fork
&& (
github.ref_name == 'main'
Expand Down

0 comments on commit a6279ee

Please sign in to comment.