From 225562bce508df7dcbd53b3b072fb0852266f552 Mon Sep 17 00:00:00 2001 From: Jeremiah <42397676+jlsnow301@users.noreply.github.com> Date: Thu, 16 May 2024 22:38:11 -0700 Subject: [PATCH] Cancel CI on new commit (#83255) ## About The Pull Request This sets concurrency at the workflow level, which should provide a more concise way to eject if a new commit is entered https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency I've also added timeouts that are between 5-15 minutes per test. Default is 360 minutes without this --- .github/workflows/ci_suite.yml | 36 ++++++++++----------- .github/workflows/codeowner_reviews.yml | 1 + .github/workflows/run_integration_tests.yml | 2 ++ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index f514e52b21f..412fda467dd 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -13,14 +13,18 @@ on: merge_group: branches: - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: run_linters: if: ( !contains(github.event.head_commit.message, '[ci skip]') ) name: Run Linters runs-on: ubuntu-22.04 - concurrency: - group: run_linters-${{ github.head_ref || github.run_id }} - cancel-in-progress: true + timeout-minutes: 5 + steps: - uses: actions/checkout@v4 - name: Restore SpacemanDMM cache @@ -130,9 +134,8 @@ jobs: name: Compile Maps needs: [collect_data] runs-on: ubuntu-22.04 - concurrency: - group: compile_all_maps-${{ github.head_ref || github.run_id }} - cancel-in-progress: true + timeout-minutes: 5 + steps: - uses: actions/checkout@v4 - name: Restore BYOND cache @@ -155,13 +158,12 @@ jobs: if: ( !contains(github.event.head_commit.message, '[ci skip]') ) name: Collect data for other tasks runs-on: ubuntu-22.04 + timeout-minutes: 5 outputs: maps: ${{ steps.map_finder.outputs.maps }} alternate_tests: ${{ steps.alternate_test_finder.outputs.alternate_tests }} max_required_byond_client: ${{ steps.max_required_byond_client.outputs.max_required_byond_client }} - concurrency: - group: find_all_maps-${{ github.head_ref || github.run_id }} - cancel-in-progress: true + steps: - uses: actions/checkout@v4 - name: Find Maps @@ -186,13 +188,12 @@ jobs: if: ( !contains(github.event.head_commit.message, '[ci skip]') ) name: Integration Tests needs: [collect_data] + strategy: fail-fast: false matrix: map: ${{ fromJSON(needs.collect_data.outputs.maps).paths }} - concurrency: - group: run_all_tests-${{ github.head_ref || github.run_id }}-${{ matrix.map }} - cancel-in-progress: true + uses: ./.github/workflows/run_integration_tests.yml with: map: ${{ matrix.map }} @@ -206,9 +207,7 @@ jobs: fail-fast: false matrix: setup: ${{ fromJSON(needs.collect_data.outputs.alternate_tests) }} - concurrency: - group: run_all_tests-${{ github.head_ref || github.run_id }}-${{ matrix.setup.major }}.${{ matrix.setup.minor }}-${{ matrix.setup.map }} - cancel-in-progress: true + uses: ./.github/workflows/run_integration_tests.yml with: map: ${{ matrix.setup.map }} @@ -221,6 +220,7 @@ jobs: name: Check Alternate Tests needs: [run_alternate_tests] runs-on: ubuntu-22.04 + timeout-minutes: 5 steps: - run: echo Alternate tests passed. @@ -228,6 +228,7 @@ jobs: if: ( !contains(github.event.head_commit.message, '[ci skip]') && (always() && (!failure() && !cancelled())) ) needs: [run_all_tests, run_alternate_tests] name: Compare Screenshot Tests + timeout-minutes: 15 runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -266,9 +267,8 @@ jobs: name: Windows Build needs: [collect_data] runs-on: windows-latest - concurrency: - group: test_windows-${{ github.head_ref || github.run_id }} - cancel-in-progress: true + timeout-minutes: 5 + steps: - uses: actions/checkout@v4 - name: Restore Yarn cache diff --git a/.github/workflows/codeowner_reviews.yml b/.github/workflows/codeowner_reviews.yml index cffab706d61..e6cfb980279 100644 --- a/.github/workflows/codeowner_reviews.yml +++ b/.github/workflows/codeowner_reviews.yml @@ -9,6 +9,7 @@ jobs: assign-users: runs-on: ubuntu-latest + timeout-minutes: 5 steps: # Checks-out your repository under $GITHUB_WORKSPACE, so the job can access it diff --git a/.github/workflows/run_integration_tests.yml b/.github/workflows/run_integration_tests.yml index 90233292ecb..7b544fef2a6 100644 --- a/.github/workflows/run_integration_tests.yml +++ b/.github/workflows/run_integration_tests.yml @@ -16,9 +16,11 @@ on: max_required_byond_client: required: true type: string + jobs: run_integration_tests: runs-on: ubuntu-latest + timeout-minutes: 15 services: mysql: image: mysql:latest