Skip to content

Commit

Permalink
CI fixes and cleanup (#42)
Browse files Browse the repository at this point in the history
* CI fixes and cleanup

* Update macos-build.yml
  • Loading branch information
SirLynix authored Jul 3, 2024
1 parent b31b760 commit 548f240
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 78 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
matrix:
os: [ubuntu-latest]
arch: [armeabi-v7a, arm64-v8a]
mode: [debug, releasedbg]
ndk_sdkver: ["28"]

runs-on: ${{ matrix.os }}
Expand All @@ -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
Expand All @@ -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
Expand Down
46 changes: 18 additions & 28 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -51,55 +51,45 @@ 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
run: xmake repo --update

# 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
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ios-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,36 @@ 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
run: xmake repo --update

# 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
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,37 @@ 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
run: xmake repo --update

# 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
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ 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 }}
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}

steps:
Expand All @@ -47,27 +46,35 @@ 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
run: xmake repo --update

# 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
Expand All @@ -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
32 changes: 15 additions & 17 deletions .github/workflows/msys2-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/wasm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ 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
run: xmake repo --update

# 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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 548f240

Please sign in to comment.