diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index bfa0427..f3a13ba 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -22,6 +22,7 @@ jobs: matrix: os: [ubuntu-latest] arch: [armeabi-v7a, arm64-v8a] + mode: [debug, releasedbg] ndk_sdkver: ["28"] runs-on: ${{ matrix.os }} @@ -44,7 +45,6 @@ jobs: uses: xmake-io/github-action-setup-xmake@v1 with: actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }} - xmake-version: branch@dev # fixes a bug in xmake 2.9.1 # Setup NDK - name: Download NDK @@ -58,19 +58,29 @@ jobs: # Fetch xmake dephash - name: Retrieve dependencies hash - id: dep_hash + id: dephash run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT + shell: bash # Cache xmake dependencies - name: Retrieve cached xmake dependencies - uses: actions/cache@v4 + id: restore-depcache + uses: actions/cache/restore@v4 with: path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages - key: Android-${{ matrix.ndk_sdkver }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} + key: Android-${{ matrix.ndk_sdkver }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} # Setup compilation mode and install project dependencies - name: Configure xmake and install dependencies - run: xmake config --tests=y --plat=android --ndk=`pwd`/android-ndk-r25c --ndk_sdkver=${{ matrix.ndk_sdkver }} --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --fs_watcher=n --tests=n --yes + run: xmake config --plat=android --ndk=`pwd`/android-ndk-r25c --ndk_sdkver=${{ matrix.ndk_sdkver }} --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --tests=y --ccache=n --fs_watcher=n --tests=n --yes + + # Save dependencies + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} # Build library - name: Build library diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0e18535..52ffffe 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,12 +21,12 @@ jobs: strategy: matrix: config: - - { name: "Windows x64", os: windows-latest, arch: x64 } - - { name: "Ubuntu x86_64", os: ubuntu-latest, arch: x86_64 } + - { name: "Windows", os: windows-latest, arch: x64 } + - { name: "Ubuntu", os: ubuntu-latest, arch: x86_64 } name: ${{ matrix.config.name }} runs-on: ${{ matrix.config.os }} - if: "!contains(github.event.head_commit.message, 'coverage skip')" + if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} steps: - name: Get current date as package key @@ -51,19 +51,14 @@ jobs: # Force xmake to a specific folder (for cache) - name: Set xmake env (Linux) - if: runner.os == 'Linux' run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV - - - name: Set xmake env (Windows) - if: runner.os == 'Windows' - run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + shell: bash # Install xmake - name: Setup xmake uses: xmake-io/github-action-setup-xmake@v1 with: actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }} - xmake-version: branch@dev # fixes a bug in xmake 2.9.1 # Update xmake repository (in order to have the file that will be cached) - name: Update xmake repository @@ -71,35 +66,30 @@ jobs: # Fetch xmake dephash - name: Retrieve dependencies hash - if: runner.os == 'Linux' - id: dep_hash_linux + id: dephash run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT - - - name: Retrieve dependencies hash - if: runner.os == 'Windows' - id: dep_hash_windows - run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + shell: bash # Cache xmake dependencies - - name: Retrieve cached xmake dependencies (Linux) - if: runner.os == 'Linux' - uses: actions/cache@v4 + - name: Retrieve cached xmake dependencies + id: restore-depcache + uses: actions/cache/restore@v4 with: path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages - key: Linux-${{ matrix.config.arch }}-coverage-${{ steps.dep_hash_linux.outputs.hash }}-W${{ steps.cache_key.outputs.key }} - - # Cache xmake dependencies - - name: Retrieve cached xmake dependencies (Windows) - if: runner.os == 'Windows' - uses: actions/cache@v4 - with: - path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages - key: MSVC-${{ matrix.config.arch }}-coverage-${{ steps.dep_hash_windows.outputs.hash }}-W${{ steps.cache_key.outputs.key }} + key: ${{ matrix.config.name}}-${{ matrix.config.arch }}-coverage-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} # Setup compilation mode and install project dependencies - name: Configure xmake and install dependencies run: xmake config --arch=${{ matrix.config.arch }} --ccache=n --tests=y --unitybuild=y --kind=shared --mode=coverage --yes + # Save dependencies + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} + # Build library and tests - name: Build library run: xmake diff --git a/.github/workflows/ios-build.yml b/.github/workflows/ios-build.yml index 7258cd5..ea78839 100644 --- a/.github/workflows/ios-build.yml +++ b/.github/workflows/ios-build.yml @@ -43,7 +43,6 @@ jobs: uses: xmake-io/github-action-setup-xmake@v1 with: actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }} - xmake-version: branch@dev # fixes a bug in xmake 2.9.1 # Update xmake repository (in order to have the file that will be cached) - name: Update xmake repository @@ -51,20 +50,29 @@ jobs: # Fetch xmake dephash - name: Retrieve dependencies hash - id: dep_hash + id: dephash run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT # Cache xmake dependencies - name: Retrieve cached xmake dependencies - uses: actions/cache@v4 + id: restore-depcache + uses: actions/cache/restore@v4 with: path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages - key: iOS-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} + key: iOS-${{ matrix.mode }}-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} # Setup compilation mode and install project dependencies - name: Configure xmake and install dependencies run: xmake config --plat=iphoneos --tests=y --mode=${{ matrix.mode }} --ccache=n --tests=n --yes + # Save dependencies + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} + # Build library and tests - name: Build library run: xmake diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 73ef739..1f51f9f 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -57,7 +57,6 @@ jobs: uses: xmake-io/github-action-setup-xmake@v1 with: actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }} - xmake-version: branch@dev # fixes a bug in xmake 2.9.1 # Update xmake repository (in order to have the file that will be cached) - name: Update xmake repository @@ -65,20 +64,30 @@ jobs: # Fetch xmake dephash - name: Retrieve dependencies hash - id: dep_hash + id: dephash run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT + shell: bash # Cache xmake dependencies - name: Retrieve cached xmake dependencies - uses: actions/cache@v4 + id: restore-depcache + uses: actions/cache/restore@v4 with: path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages - key: Linux-${{ matrix.arch }}-${{ matrix.confs.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} + key: Linux-${{ matrix.arch }}-${{ matrix.confs.mode }}-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} # Setup compilation mode and install project dependencies - name: Configure xmake and install dependencies run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} --kind=${{ matrix.kind }} --ccache=n --examples=y --tests=y --unitybuild=y --yes + # Save dependencies + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} + # Build library and tests - name: Build library run: xmake diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 82378b9..1ee1635 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -21,11 +21,10 @@ jobs: strategy: fail-fast: false matrix: + os: [macOS-latest] mode: [debug, releasedbg] kind: [static, shared] - confs: - - { runner: macOS-latest, arch: x86_64 } - - { runner: macOS-14, arch: arm64 } + arch: [x86_64, arm64] runs-on: ${{ matrix.confs.runner }} if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} @@ -47,7 +46,6 @@ jobs: uses: xmake-io/github-action-setup-xmake@v1 with: actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }} - xmake-version: branch@dev # fixes a bug in xmake 2.9.1 # Update xmake repository (in order to have the file that will be cached) - name: Update xmake repository @@ -55,19 +53,28 @@ jobs: # Fetch xmake dephash - name: Retrieve dependencies hash - id: dep_hash + id: dephash run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT # Cache xmake dependencies - name: Retrieve cached xmake dependencies - uses: actions/cache@v4 + id: restore-depcache + uses: actions/cache/restore@v4 with: path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages - key: macOS-${{ matrix.confs.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} + key: macOS-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} # Setup compilation mode and install project dependencies - name: Configure xmake and install dependencies - run: xmake config --arch=${{ matrix.confs.arch }} --mode=${{ matrix.mode }} --kind=${{ matrix.kind }} --ccache=n --examples=y --tests=y --unitybuild=y --yes + run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --kind=${{ matrix.kind }} --ccache=n --examples=y --tests=y --unitybuild=y --yes + + # Save dependencies + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} # Build library and tests - name: Build library @@ -84,5 +91,5 @@ jobs: # Upload artifacts - uses: actions/upload-artifact@v4 with: - name: nzsl-macOS-${{ matrix.confs.arch }}-${{ matrix.kind }}-${{ matrix.mode }} + name: nzsl-macOS-${{ matrix.arch }}-${{ matrix.kind }}-${{ matrix.mode }} path: package diff --git a/.github/workflows/msys2-build.yml b/.github/workflows/msys2-build.yml index 3db966f..a0d5a2b 100644 --- a/.github/workflows/msys2-build.yml +++ b/.github/workflows/msys2-build.yml @@ -50,21 +50,9 @@ jobs: - uses: msys2/setup-msys2@v2 with: msystem: ${{ matrix.msystem }} - install: base-devel git unzip p7zip mingw-w64-${{ matrix.arch }}-toolchain + install: base-devel git unzip p7zip mingw-w64-${{ matrix.arch }}-toolchain mingw-w64-${{ matrix.arch }}-xmake update: true - # Update xmake to nightly (fixes a bug in xmake 2.9.1) - - name: Install xmake dev - shell: msys2 {0} - run: | - git clone https://github.com/xmake-io/xmake.git --recurse-submodules -b dev xmake-src - cd xmake-src - ./configure - make -j4 - make install PREFIX=/${{ matrix.msystem }} - xmake --version - cd .. - # Force xmake to a specific folder (for cache) - name: Set xmake env run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV @@ -75,20 +63,30 @@ jobs: # Fetch xmake dephash - name: Retrieve dependencies hash - id: dep_hash + id: dephash run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT - + shell: bash + # Cache xmake dependencies - name: Retrieve cached xmake dependencies - uses: actions/cache@v4 + id: restore-depcache + uses: actions/cache/restore@v4 with: path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages - key: MinGW-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} + key: MinGW-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} # Setup compilation mode and install project dependencies - name: Configure xmake and install dependencies run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --kind=${{ matrix.kind }} --ccache=n --examples=y --tests=y --unitybuild=n --yes + # Save dependencies + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} + # Build library and tests - name: Build library run: xmake diff --git a/.github/workflows/wasm-build.yml b/.github/workflows/wasm-build.yml index 17ed85e..defed67 100644 --- a/.github/workflows/wasm-build.yml +++ b/.github/workflows/wasm-build.yml @@ -46,7 +46,6 @@ jobs: uses: xmake-io/github-action-setup-xmake@v1 with: actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }} - xmake-version: branch@dev # fixes a bug in xmake 2.9.1 # Update xmake repository (in order to have the file that will be cached) - name: Update xmake repository @@ -54,8 +53,9 @@ jobs: # Fetch xmake dephash - name: Retrieve dependencies hash - id: dep_hash + id: dephash run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT + shell: bash # Setup emsdk - name: Setup emscripten @@ -66,15 +66,24 @@ jobs: # Cache xmake dependencies - name: Retrieve cached xmake dependencies - uses: actions/cache@v4 + id: restore-depcache + uses: actions/cache/restore@v4 with: path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages - key: Wasm-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} + key: Wasm-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} # Setup compilation mode and install project dependencies - name: Configure xmake and install dependencies run: xmake config --plat=wasm --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --kind=${{ matrix.kind }} --ccache=n --fs_watcher=n --tests=n --unitybuild=y --yes + # Save dependencies + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} + # Build library and tests - name: Build library run: xmake diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index eeb1232..3f596ef 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -52,8 +52,6 @@ jobs: # Install xmake - name: Setup xmake uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: branch@dev # fixes a bug in xmake 2.9.1 # Update xmake repository (in order to have the file that will be cached) - name: Update xmake repository @@ -61,20 +59,30 @@ jobs: # Fetch xmake dephash - name: Retrieve dependencies hash - id: dep_hash - run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + id: dephash + run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT + shell: bash # Cache xmake dependencies - name: Retrieve cached xmake dependencies - uses: actions/cache@v4 + id: restore-depcache + uses: actions/cache/restore@v4 with: path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages - key: MSVC-${{ matrix.arch }}-${{ matrix.config.mode }}-${{ matrix.config.runtime }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} + key: MSVC-${{ matrix.arch }}-${{ matrix.config.mode }}-${{ matrix.config.runtime }}-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }} # Setup compilation mode and install project dependencies - name: Configure xmake and install dependencies run: xmake config --arch=${{ matrix.arch }} --kind=${{ matrix.config.kind }} --mode=${{ matrix.config.mode }} --vs_runtime=${{ matrix.config.runtime }} --ccache=n --examples=y --tests=y --unitybuild=y --yes + # Save dependencies + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} + # Build library and tests - name: Build library run: xmake