Skip to content
Closed
Changes from 1 commit
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
47 changes: 47 additions & 0 deletions .github/workflows/precommit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Precommit tests"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we'll be able to use the same file for Windows testing? If not, I would call this "Linux Precommit Tests" and change the filename too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning on a separate file per OS. Github doesn't have native runs-on support for containers on Windows, so we'll have to run the docker commands explicitly. The container image would need to be different either way, which means we would at least need separate jobs. I'm hoping to make sure common parts are pulled out into something common, but the OSes are different (at least as exposed to GHA for the way I want to use it).


permissions:
contents: read

on:
pull_request:
branches:
- main
paths:
- '.github/workflows/precommit.yaml'
- 'llvm/**'

jobs:
build-llvm:
name: "Build and test LLVM"
runs-on: ubuntu-latest
container:
image: ghcr.io/llvm/ci-ubuntu-22.04:latest
steps:
- name: Fetch LLVM sources
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
max-size: 500M
variant: sccache
key: precommit-linux
- name: Configure LLVM
run: |
cmake -B llvm-build -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLLVM_LIT_ARGS="-v --no-progress-bar" \
./llvm
- name: Build LLVM
run: |
ninja -C llvm-build llvm-test-depends
- name: Check LLVM
run: |
ninja -C llvm-build check-llvm