From 6ab7443e8196c83905e7c75fea146eba923a2606 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Sat, 2 Nov 2024 18:30:20 +0100 Subject: [PATCH] [CI] fix linux CI --- .github/workflows/Linux.yml | 196 +++++++++++++++++++----------------- .github/workflows/macOS.yml | 16 +-- 2 files changed, 109 insertions(+), 103 deletions(-) diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index 592aa086..539cdfc6 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -1,95 +1,101 @@ -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-MSVC.yml' - - '.github/workflows/Linux.yml' - - '.github/workflows/macOS.yml' - - '.github/workflows/iOS.yml' - - '.github/workflows/Android.yml' - - '.github/workflows/AutoMerger.yml' - - '.gitignore' - - 'LICENSE' - - 'README.md' - -jobs: - build: - name: ${{ matrix.os }}-x64 ( ${{ matrix.kind }}-${{ matrix.mode }} ) - - strategy: - fail-fast: false - matrix: - os: [Linux] - kind: [static, shared] - mode: [release, debug, asan] - - runs-on: ${{ matrix.os }} - - concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Linux-${{ 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: Set xmake env - run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV - - - name: Install XMake - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: branch@dev - actions-cache-folder: .xmake-cache-${{ steps.cache_key.outputs.key }} - - - name: Update xmake to patched xmake - run: xmake update -s https://github.com/Arthapz/xmake.git#modules - - - 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.mode }}-${{ steps.dep_hash.outputs.hash }}-${{ steps.cache_key.outputs.key }} - - - name: Configure & Build - id: build - run: | - xmake f -v --yes -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --sanitizers=${{ matrix.mode == 'asan' && 'y' || 'n' }} --examples=y --tests=y --toolchain=llvm --mold=y --runtimes="c++_shared" --sdk="/opt/llvm-git/usr" - xmake b -v - - - name: Tests - run: LD_LIBRARY_PATH="/opt/llvm-git/usr/lib" xmake test -v - - - name: Installation - run: xmake install -v --installdir="${{ runner.workspace }}/output" - - - name: Upload artifacts - id: upload - uses: actions/upload-artifact@v1 - with: - name: Linux-x64-${{ matrix.kind }}-${{ matrix.mode }} - path: ${{ runner.workspace }}/output +--- +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: ${{ matrix.os }}-x64 ( ${{ matrix.kind }}-${{ matrix.mode }} ) + + strategy: + fail-fast: false + matrix: + os: [Linux] + arch: [x64, arm64] + kind: [static, shared] + mode: [release, debug] + + runs-on: ${{ matrix.os }}-${{ matrix.arch }} + + concurrency: + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Linux-${{ 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.3" + directory: ${{ runner.temp }}/llvm + + - name: Configure & Build + id: build + run: | + xmake f -v --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 diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index 1696fcb7..38b42ca8 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -34,11 +34,11 @@ jobs: fail-fast: false matrix: os: [macOS-15] - arch: [x86_64, arm64] + arch: [x64, arm64] kind: [static, shared] mode: [release, debug] - runs-on: ${{ matrix.os }}${{ (matrix.arch == 'x86_64') && '-large' || '' }} + runs-on: ${{ matrix.os }}${{ (matrix.arch == 'x64') && '-large' || '' }} concurrency: group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-macOS-${{ matrix.kind }}-${{ matrix.mode }} @@ -65,7 +65,7 @@ jobs: with: xmake-version: Arthapz/xmake#branch@fix-xlinker-rpath-deduplication actions-cache-folder: .xmake-cache - actions-cache-key: macos-ci + actions-cache-key: macos-${{ matrix.arch }}-ci - name: Update xmake repository run: xmake repo --update -v @@ -74,11 +74,11 @@ jobs: 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: macOS-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-${{ steps.cache_key.outputs.key }} + # - 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: Configure & Build id: build