diff --git a/.github/workflows/precommit-linux.yaml b/.github/workflows/precommit-linux.yaml new file mode 100644 index 0000000000000..f563994ffc781 --- /dev/null +++ b/.github/workflows/precommit-linux.yaml @@ -0,0 +1,53 @@ +name: "Linux Precommit Tests" + +permissions: + contents: read + +on: + pull_request: + branches: + - main + paths: + - '.github/workflows/precommit.yaml' + - 'llvm/**' + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + build-llvm-linux: + name: "Build and test LLVM (Linux)" + 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" \ + -S ./llvm + - name: Build LLVM + run: | + ninja -C llvm-build llvm-test-depends + - name: Check LLVM + run: | + ninja -C llvm-build check-llvm