From c8a459cebdf1eb31834826178f412322f0f0efe4 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Thu, 23 May 2024 01:59:18 -0400 Subject: [PATCH] Test the CI --- .github/workflows/build.yml | 93 +++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3697f8cf26..43bea12fe43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -146,6 +146,99 @@ jobs: with: key: homebrew-${{ hashFiles('Brewfile.lock.json') }} path: ~/Library/Caches/Homebrew/downloads + macos-arm: + name: macos-arm + runs-on: macos-12 + env: + CMAKE_OPTS: >- + -DUSE_WERROR=ON + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DUSE_COMPILE_CACHE=ON + -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 + CCACHE_MAXSIZE: 0 + CCACHE_NOCOMPRESS: 1 + MAKEFLAGS: -j3 + DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer + steps: + - name: Check out + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + - name: Clean up Homebrew download cache + run: rm -rf ~/Library/Caches/Homebrew/downloads + - name: Restore Homebrew download cache + uses: actions/cache/restore@v3 + with: + key: n/a - only restore from restore-keys + restore-keys: | + homebrew- + path: ~/Library/Caches/Homebrew/downloads + - name: Cache ccache data + uses: actions/cache@v3 + with: + key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }} + restore-keys: | + ccache-${{ github.job }}-${{ github.ref }}- + ccache-${{ github.job }}- + path: ~/Library/Caches/ccache + - name: Install dependencies + run: | + wget -O $HOME/wrongbrew.sh https://gist.github.com/tresf/9a45e1400a91f4c9c14a2240967094ff/raw/wrongbrew.sh + chmod +x $HOME/wrongbrew.sh + $HOME/wrongbrew.sh bundle install + brew install cmake qt@5 fltk + mv "$("$HOME/wrongbrew.sh" --prefix qt@5)/bin" "$("$HOME/wrongbrew.sh" --prefix qt@5)/x86_64_bin" + ln -s "$(brew --prefix qt@5)/bin" "$("$HOME/wrongbrew.sh" --prefix qt@5)/bin" + mv "$("$HOME/wrongbrew.sh" --prefix fltk)/bin" "$("$HOME/wrongbrew.sh" --prefix fltk)/x86_64_bin" + ln -s "$(brew --prefix fltk)/bin" "$("$HOME/wrongbrew.sh" --prefix fltk)/bin" + mv "$("$HOME/wrongbrew.sh" --prefix pkg-config)/bin" "$("$HOME/wrongbrew.sh" --prefix pkg-config)/x86_64_bin" + ln -s "$(brew --prefix pkg-config)/bin" "$("$HOME/wrongbrew.sh" --prefix pkg-config)/bin" + npm update -g npm + npm install --location=global appdmg + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_UPGRADE: 1 + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + - name: Configure + run: | + ccache --zero-stats + mkdir build + cmake -S . \ + -B build \ + -DCMAKE_INSTALL_PREFIX="../target" \ + -DCMAKE_PREFIX_PATH=$($HOME/wrongbrew.sh --prefix qt@5);$($HOME/wrongbrew.sh --prefix) \ + $CMAKE_OPTS \ + -DUSE_WERROR=OFF + - name: Build + run: cmake --build build + - name: Run tests + run: | + cd build/tests + ctest --output-on-failure -j3 + - name: Package + run: | + cmake --build build --target install + cmake --build build --target dmg + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: macos + path: build/lmms-*.dmg + - name: Trim ccache and print statistics + run: | + ccache --cleanup + echo "[ccache config]" + ccache --show-config + echo "[ccache stats]" + ccache --show-stats --verbose + env: + CCACHE_MAXSIZE: 500MB + - name: Save Homebrew download cache + uses: actions/cache/save@v3 + with: + key: homebrew-${{ hashFiles('Brewfile.lock.json') }} + path: ~/Library/Caches/Homebrew/downloads mingw: strategy: fail-fast: false