From e44701234c945dcfaac05649978689c5cbe47f5f Mon Sep 17 00:00:00 2001 From: Abhinav Bhatele Date: Tue, 17 Oct 2023 15:42:09 -0400 Subject: [PATCH] add dependencies between workflows (#41) * QOL changes to the CI - dependency between formatting and nvidia-gpu tests, cancel ongoing tests on push --------- Co-authored-by: Siddharth Singh --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ .../{formatting-tests.yaml => formatting.yaml} | 17 ++++++++--------- ...a-tests.yaml => nvidia-rtx-3090-tests.yaml} | 14 +++++++++----- 3 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/ci.yaml rename .github/workflows/{formatting-tests.yaml => formatting.yaml} (71%) rename .github/workflows/{nvidia-tests.yaml => nvidia-rtx-3090-tests.yaml} (85%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5f32310 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,18 @@ +name: ci + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +concurrency: + group: ci-${{github.ref}}-${{github.event.pull_request.number || github.run_number}} + cancel-in-progress: true + +jobs: + formatting: + uses: ./.github/workflows/formatting.yaml + nvidia-gpu: + needs: [ formatting ] + uses: ./.github/workflows/nvidia-rtx-3090-tests.yaml diff --git a/.github/workflows/formatting-tests.yaml b/.github/workflows/formatting.yaml similarity index 71% rename from .github/workflows/formatting-tests.yaml rename to .github/workflows/formatting.yaml index 5d09fa9..7cdac5c 100644 --- a/.github/workflows/formatting-tests.yaml +++ b/.github/workflows/formatting.yaml @@ -1,18 +1,16 @@ name: formatting tests on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] + workflow_dispatch: + workflow_call: + +concurrency: + group: unit_tests-${{github.ref}}-${{github.event.pull_request.number || github.run_number}} + cancel-in-progress: true jobs: formatting: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest, macos-latest] + runs-on: [ubuntu-latest] steps: - uses: actions/checkout@v2 @@ -34,3 +32,4 @@ jobs: run: | black --diff --check . flake8 + diff --git a/.github/workflows/nvidia-tests.yaml b/.github/workflows/nvidia-rtx-3090-tests.yaml similarity index 85% rename from .github/workflows/nvidia-tests.yaml rename to .github/workflows/nvidia-rtx-3090-tests.yaml index 3827c8b..266841c 100644 --- a/.github/workflows/nvidia-tests.yaml +++ b/.github/workflows/nvidia-rtx-3090-tests.yaml @@ -1,10 +1,12 @@ name: nvidia-rtx-3090 tests on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] + workflow_dispatch: + workflow_call: + +concurrency: + group: unit_tests-${{github.ref}}-${{github.event.pull_request.number || github.run_number}} + cancel-in-progress: true jobs: inter-layer: @@ -13,7 +15,8 @@ jobs: strategy: matrix: ginter: [ 1, 2 ] - memopt: [ '0', '1' ] + memopt: [ '0', '1' ] + steps: - uses: actions/checkout@v3 - name: Install AxoNN @@ -36,6 +39,7 @@ jobs: intra-layer: runs-on: [ nvidia ] + steps: - uses: actions/checkout@v3 - name: Install AxoNN