Skip to content

Commit

Permalink
Make Github Actions staged
Browse files Browse the repository at this point in the history
First run a simple gcc, clang-format and codeql, only if those pass
trigger the rest.
  • Loading branch information
crtrott committed Sep 19, 2024
1 parent c67d604 commit 13db853
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: clang-format check

on: [push, pull_request]
on:
workflow_call:

permissions: read-all

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ name: "CodeQL"
on:
push:
branches: [ "master", "develop", "release-*" ]
pull_request:
branches: [ "develop" ]

permissions: read-all
workflow_call:

jobs:
analyze:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ on:
push:
branches:
- develop
pull_request:
paths-ignore:
- '**/*.md'
types: [ opened, reopened, synchronize ]
workflow_call:

permissions: read-all

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}-cilnx32
cancel-in-progress: ${{github.event_name == 'pull_request'}}

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ on:
push:
branches:
- develop
pull_request:
paths-ignore:
- '**/*.md'
types: [ opened, reopened, synchronize ]
workflow_call:

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}-cilnxhpx
cancel-in-progress: ${{github.event_name == 'pull_request'}}

permissions: read-all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ on:
push:
branches:
- develop
pull_request:
paths-ignore:
- '**/*.md'
types: [ opened, reopened, synchronize ]
workflow_call:

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}-cilnx
cancel-in-progress: ${{github.event_name == 'pull_request'}}

permissions: read-all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ on:
push:
branches:
- develop
pull_request:
paths-ignore:
- '**/*.md'
types: [ opened, reopened, synchronize ]
workflow_call:

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}-ciosx
cancel-in-progress: ${{github.event_name == 'pull_request'}}

permissions: read-all
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/continuous-integration-snifftest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: basic-test

on:
push:
branches:
- develop
workflow_call:

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}-cibasic
cancel-in-progress: ${{github.event_name == 'pull_request'}}

permissions: read-all

jobs:
gcc-serial-cpp17:
name: gcc-openmp-cpp17
runs-on: [ubuntu-latest]

steps:
- name: checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: kokkos

- name: configure kokkos
run: |
mkdir -p kokkos/{build,install}
cd kokkos/build
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$PWD/../install \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_FLAGS="-Werror" \
-DKokkos_ENABLE_COMPILER_WARNINGS=ON \
-DKokkos_ENABLE_DEPRECATED_CODE_4=OFF \
-DKokkos_ENABLE_EXAMPLES=ON \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_TESTS=ON \
..
- name: build_and_install_kokkos
working-directory: kokkos/build
run: make -j2 install

- name: test_kokkos
working-directory: kokkos/build
run: ctest --timeout 2000 -j1 --output-on-failure
62 changes: 62 additions & 0 deletions .github/workflows/continuous-integration-stager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: staged-continuous-integration

on:
push:
branches:
- develop
pull_request:
paths-ignore:
- '**/*.md'
types: [ opened, reopened, synchronize ]

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}

permissions: read-all

jobs:
# pre-stage
clang-format-check:
uses: ./.github/workflows/clang-format-check.yml

codeql:
# need to set manual permissions since it requires security-events write
# but then we have to set everything else manually to read since the
# default is overwritten
permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read

uses: ./.github/workflows/codeql.yml

initial-check:
uses: ./.github/workflows/continuous-integration-snifftest.yml

# primary testing
windows-cuda:
needs: [initial-check, codeql, clang-format-check]
uses: ./.github/workflows/continuous-integration-windows.yml

standard-linux:
needs: [initial-check, codeql, clang-format-check]
uses: ./.github/workflows/continuous-integration-linux.yml

hpx-linux:
needs: [initial-check, codeql, clang-format-check]
uses: ./.github/workflows/continuous-integration-linux-hpx.yml

linux-32bit:
needs: [initial-check, codeql, clang-format-check]
uses: ./.github/workflows/continuous-integration-linux-32bit.yml

osx:
needs: [initial-check, codeql, clang-format-check]
uses: ./.github/workflows/continuous-integration-osx.yml

performance-test:
needs: [initial-check, codeql, clang-format-check]
uses: ./.github/workflows/performance-benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: github-windows

on:
push:
pull_request:
workflow_call:

concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}-ciwnds
cancel-in-progress: ${{github.event_name == 'pull_request'}}

permissions: read-all
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/performance-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ on:
push:
branches:
- develop
pull_request:
paths-ignore:
- '**/*.md'
types: [ opened, reopened, synchronize ]
workflow_call:

permissions: read-all

Expand Down

0 comments on commit 13db853

Please sign in to comment.