[llvm] [workflows] Port buildkite Windows config to GitHub actions (PR #82093)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 28 06:37:46 PDT 2024
================
@@ -0,0 +1,198 @@
+name: "Windows Precommit Tests"
+
+permissions:
+ contents: read
+
+on:
+ pull_request:
+ branches:
+ - main
+
+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:
+ compute-projects:
+ name: "Compute Projects to Test"
+ runs-on: ubuntu-22.04
+ outputs:
+ projects: ${{ steps.vars.outputs.projects }}
+ check-targets: ${{ steps.vars.outputs.check-targets }}
+ test-build: ${{ steps.vars.outputs.check-targets != '' }}
+ steps:
+ - name: Fetch LLVM sources
+ uses: actions/checkout at v4
+ with:
+ fetch-depth: 2
+
+ - name: Compute projects to test
+ id: vars
+ uses: ./.github/workflows/compute-projects-to-test
+
+ build-windows-part1:
+ name: "Build LLVM/Clang"
+ runs-on: windows-2022
+ needs:
+ - compute-projects
+ if: ${{ needs.compute-projects.outputs.test-build == 'true' }}
+ steps:
+ - name: Setup Windows
+ uses: llvm/actions/setup-windows at main
+ with:
+ arch: amd64
+
+ - name: Fetch LLVM sources
+ uses: actions/checkout at v4
+
+ - name: Setup sccache
+ uses: hendrikmuhs/ccache-action at v1
+ with:
+ max-size: 2G
+ variant: sccache
+ key: precommit-windows
+
+ - name: Restore sccache from previous PR run
+ uses: ./.github/workflows/pr-sccache-restore
+
+ - name: Compute projects to test
+ id: compute-projects
+ uses: ./.github/workflows/compute-projects-to-test
+
+ - name: Configure LLVM
+ shell: bash
+ run: |
+ cmake -B build -GNinja \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_PROJECTS="${{ needs.compute-projects.outputs.projects }}" \
+ -DLLVM_ENABLE_ASSERTIONS=ON \
+ -DLLVM_LIT_ARGS="-v --no-progress-bar" \
+ -DCMAKE_C_COMPILER_LAUNCHER=sccache \
+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
+ -S llvm
+
+ - name: Build
+ shell: bash
+ run: |
+ targets="llc"
+ if echo "${{ needs.compute-projects.outputs.check-targets }}" | grep clang; then
+ targets="$targets clang"
+ fi
+ ninja -C build $targets
----------------
joker-eph wrote:
I don't follow this step's logic here? Is llc a universal dependency?
https://github.com/llvm/llvm-project/pull/82093
More information about the llvm-commits
mailing list