[XMake] fix libKTX compilation #302
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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: Add LLVM apt repository | |
uses: myci-actions/add-deb-repo@11 | |
with: | |
repo: deb http://apt.llvm.org/noble/ llvm-toolchain-noble main | |
repo-name: llvm | |
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key | |
- name: Install LLVM and Clang | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: clang libc++-dev libc++1 libc++abi-dev libc++abi1 mold llvm-runtime llvm libxkbcommon-x11-dev libxkbcommon-x11 libktx-dev libktx xutils-dev x11proto-dev libxau-dev libxdmcp-dev libxcb1-dev libxcb-damage0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-xrm-dev libxcb-xinput-dev libxcb-dpms0-dev libxcb-xvmc0-dev libxcb-xv0-dev libxcb-xtest0-dev libxcb-xfreedri0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-shape0-dev libxcb-present-dev libxcb-xkb-dev libxcb-xfixes0-dev libxcb-xevie0-dev libxcb-shm0-dev libxcb-dri2-0-dev libxcb-sync0-dev libxcb-composite0-dev libxcb-xinerama0-dev libxcb-screensaver-dev libxcb-record0-dev libxau-dev build-essential cmake libzstd-dev ninja-build doxygen graphviz opencl-c-headers mesa-opencl-icd | |
- 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" | |
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 |