Skip to content

[CI] fix LLVM installation on Linux CI #291

[CI] fix LLVM installation on Linux CI

[CI] fix LLVM installation on Linux CI #291

Workflow file for this run

---
name: Linux
on:
pull_request:
branches: [main, develop]
paths-ignore:
- .github/workflows/Windows-LLVM.yml
- .github/workflows/Windows-MSVC.yml
- .github/workflows/macOS.yml
- .github/workflows/iOS.yml
- .github/workflows/Android.yml
- .github/workflows/AutoMerger.yml
- .gitignore
- LICENSE
- README.md
push:
branches: [develop]
paths-ignore:
- .github/workflows/Windows-LLVM.yml
- .github/workflows/Windows-MSVC.yml
- .github/workflows/macOS.yml
- .github/workflows/iOS.yml
- .github/workflows/Android.yml
- .github/workflows/AutoMerger.yml
- .gitignore
- LICENSE
- README.md
jobs:
build:
name: Linux-${{ matrix.arch }} ( ${{ matrix.kind }}-${{ matrix.mode }} )
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
arch: [x64, arm64]
kind: [static, shared]
mode: [release, debug]
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.kind }}-${{ matrix.mode }}
steps:
- name: Get current date as package key
id: cache_key
run: echo "key=$(date +'%W')" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install XMake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: Arthapz/xmake#branch@fix-xlinker-rpath-deduplication
actions-cache-folder: .xmake-cache
actions-cache-key: linux-${{ matrix.arch }}-ci
- name: Update xmake repository
run: xmake repo --update -v
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT
# - name: Retrieve cached xmake dependencies
# uses: actions/cache@v4
# with:
# path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
# key: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-${{ steps.cache_key.outputs.key }}
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "19.1"
directory: ${{ runner.temp }}/llvm
arch: ${{ matrix.arch }}
- name: Configure & Build
id: build
run: |
xmake f -v -a ${{ (matrix.arch == 'x64') && 'x86_64' || (matrix.arch == 'arm64') && 'aarch64' || matrix.arch }} --yes -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --sanitizers=${{ matrix.mode == 'debug' && 'y' || 'n' }} --examples=y --tests=y --toolchain=llvm --mold=y --runtimes="c++_shared" --sdk="${{ runner.temp }}/llvm"
xmake b -v
- name: Tests
run: xmake test -v
- name: Installation
run: xmake install -v --installdir="${{ runner.workspace }}/output"
- name: Upload artifacts
id: upload
uses: actions/upload-artifact@v4
with:
name: Linux-x64-${{ matrix.kind }}-${{ matrix.mode }}
path: ${{ runner.workspace }}/output