Skip to content

Commit

Permalink
ci: Use workflow_call and actions/checkout@v4
Browse files Browse the repository at this point in the history
  • Loading branch information
yeetari committed Feb 4, 2024
1 parent be81656 commit 0bf513e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 12 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build
on: [push, pull_request]
on: [workflow_call]

jobs:
build:
name: Build
Expand All @@ -10,8 +11,8 @@ jobs:
matrix:
preset: [release-clang, release-gcc]
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure CMake
run: >-
cmake .
Expand All @@ -23,7 +24,9 @@ jobs:
-DVULL_BUILD_SANDBOX=On
-DVULL_BUILD_TESTS=On
-GNinja
- name: Build
run: cmake --build build

- name: Run tests
run: cmake --build build --target test
16 changes: 10 additions & 6 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
name: Code Style
on: [push, pull_request]
on: [workflow_call]

jobs:
clang-format:
name: Clang Format
runs-on: ubuntu-latest
container: ghcr.io/yeetari/vull:master
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run clang-format
shell: bash
run: |
git config --global --add safe.directory $(pwd)
find . \( -name '*.cc' -or -name '*.hh' \) -and -not -name 'context_table.*' -and -not -name 'vulkan.*' | xargs clang-format-16 -i
find . \( -name '*.cc' -or -name '*.hh' \) \
-and -not -name 'context_table.*' \
-and -not -name 'vulkan.*' |
xargs clang-format -i
git diff | tee format-diff
if [ -s format-diff ]; then exit 1; fi
Expand All @@ -21,8 +25,8 @@ jobs:
runs-on: ubuntu-latest
container: ghcr.io/yeetari/vull:master
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run include-what-you-use
run: |
./tools/run_iwyu.bash | tee output
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI Runner
on: [push, pull_request]

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-runner
cancel-in-progress: true

jobs:
code-style:
name: Code Style
uses: ./.github/workflows/code_style.yml

static-analysis:
name: Static Analysis
needs: code-style
uses: ./.github/workflows/static_analysis.yml

build:
name: Build
needs: static-analysis
uses: ./.github/workflows/build.yml
8 changes: 5 additions & 3 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Static Analysis
on: [push, pull_request]
on: [workflow_call]

jobs:
clang-tidy:
name: Clang Tidy
runs-on: ubuntu-latest
container: ghcr.io/yeetari/vull:master
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake . --preset debug-clang -Bbuild

- name: Run clang-tidy
run: |
find engine/sources sandbox \
Expand Down

0 comments on commit 0bf513e

Please sign in to comment.