Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only continue tests.yml workflow if not canceled #5018

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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