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

Clean workflows #12

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions .github/workflows/cpu_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ on:
description: "The number of the pull request that triggered the test"
required: false
type: number
is_duplicate:
description: "Indicate if the run would be a duplicate"
required: false
default: false
type: boolean

concurrency:
group: ${{ github.event_name != 'workflow_dispatch' && format('{0}-{1}-{2}', github.workflow, inputs.pr_number, inputs.toolchain) || github.run_id }}
Expand All @@ -42,6 +47,7 @@ jobs:
image: ghcr.io/gyselax/gyselalibxx_env:latest
options: --user root
name: CPU Test (${{ inputs.toolchain }})
if: ${{ (! inputs.is_duplicate) || true }}
steps:
- name: Checkout gyselalibxx
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/gpu_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
description: "The number of the pull request that triggered the test"
required: false
type: number
is_duplicate:
description: "Indicate if the run would be a duplicate"
required: false
default: false
type: boolean

concurrency:
group: ${{ github.event_name != 'workflow_dispatch' && format('{0}-{1}', github.workflow, inputs.pr_number) || github.run_id }}
Expand All @@ -27,6 +32,7 @@ jobs:
gpu_tests:
runs-on: self-hosted
environment: development
if: ${{ (! inputs.is_duplicate) || true }}
steps:
- name: Checkout gyselalibxx
uses: actions/checkout@v4
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
name: 'Check for unnecessary runs'
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
# Map a step output to a job output
Expand All @@ -25,15 +25,7 @@ jobs:
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
skip_after_successful_duplicate: 'true'
paths:
- "src/**/*.hpp"
- "src/**/*.cpp"
- "tests/**/*.hpp"
- "tests/**/*.cpp"
- "simulations/**/*.hpp"
- "simulations/**/*.cpp"
- "**/CMakeLists.txt"
- "vendor/**"
paths: '["src/**/*.hpp", "src/**/*.cpp", "tests/**/*.hpp", "tests/**/*.cpp", "simulations/**/*.hpp", "simulations/**/*.cpp", "**/CMakeLists.txt", "vendor/**"]'
cancel_others: 'false'

cpu_tests:
Expand All @@ -43,12 +35,12 @@ jobs:
fail-fast: false
name: CPU Test (${{ matrix.toolchain }})
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' && github.event.pull_request.draft == false
uses: ./.github/workflows/cpu_tests.yml
with:
toolchain: ${{ matrix.toolchain }}
merge_target: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
pr_number: ${{ github.event.pull_request.number }}
is_duplicate: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event.pull_request.draft == false }}

gpu_tests:
name: GPU Test
Expand All @@ -58,6 +50,7 @@ jobs:
with:
merge_target: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
pr_number: ${{ github.event.pull_request.number }}
is_duplicate: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event.pull_request.draft == false }}

set_draft_failing:
runs-on: ubuntu-latest
Expand Down
Loading