From edd03af8b953e83e3597672eb2cede8fd03794e1 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Mon, 2 Dec 2024 13:25:45 +1100 Subject: [PATCH] Streamline GitHub Actions Runs - Don't double run (For both PR and Push to any branch) - Cancel if a new Run starts --- .github/workflows/doc-qa.yaml | 16 ++++++++++++++-- .github/workflows/main.yml | 2 ++ .github/workflows/test-conda-build.yml | 20 +++++++++++++++----- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/doc-qa.yaml b/.github/workflows/doc-qa.yaml index 7dea4db28..a772eee9f 100644 --- a/.github/workflows/doc-qa.yaml +++ b/.github/workflows/doc-qa.yaml @@ -1,10 +1,22 @@ name: Doc QA + on: - # Triggers the workflow on pull request events for the main branch - pull_request_target: + push: branches: + - main - develop - develop-1.9 + pull_request: + branches: + - develop + - develop-1.9 + +concurrency: + # Here the group is defined by the head_ref of the PR + group: ${{ github.head_ref }} + # Here we specify that we'll cancel any "in progress" workflow of the same group. Thus if we push, ammend a commit and push + # again the previous workflow will be cancelled, thus saving us github action build minutes and avoid any conflicts + cancel-in-progress: true jobs: doctor-rst: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed06f65a9..a46d93eef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,8 @@ on: push: branches: - main + - develop + - develop-1.9 pull_request: branches: - develop diff --git a/.github/workflows/test-conda-build.yml b/.github/workflows/test-conda-build.yml index 6413b61ae..3e92697b3 100644 --- a/.github/workflows/test-conda-build.yml +++ b/.github/workflows/test-conda-build.yml @@ -1,12 +1,22 @@ name: Conda Smoke Test + on: + push: + branches: + - main + - develop + - develop-1.9 pull_request: - paths: - - '**' + branches: + - develop + - develop-1.9 - push: - paths: - - '**' +concurrency: + # Here the group is defined by the head_ref of the PR + group: ${{ github.head_ref }} + # Here we specify that we'll cancel any "in progress" workflow of the same group. Thus if we push, ammend a commit and push + # again the previous workflow will be cancelled, thus saving us github action build minutes and avoid any conflicts + cancel-in-progress: true jobs: check-conda: