From 55384781a106adbbb576aed119e806915ccacb41 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Mon, 17 Jun 2024 23:10:03 +0200 Subject: [PATCH] Update CI and Add MacOS ARM --- .github/workflows/compilation.yml | 68 +++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 4ccaef088..e1b9828e1 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -35,8 +35,8 @@ jobs: fail-fast: false matrix: config: - - { name: "gcc 13", cc: gcc-13, tidy: "On" } - - { name: "clang 15", cc: clang-15, tidy: "Off" } + - { name: "gcc 14", cc: gcc-14, tidy: "On" } + - { name: "clang 16", cc: clang-16, tidy: "Off" } steps: - uses: actions/checkout@v4 @@ -55,7 +55,7 @@ jobs: -DUSE_TIDY=${{ matrix.config.tidy }} \ -DUSE_TESTS=On \ -DUSE_TOOLS=On .. - make -j2 + make -j $(getconf _NPROCESSORS_ONLN) - name: Run tests run: | @@ -83,8 +83,8 @@ jobs: run: | mkdir build-release && cd build-release cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=release .. - make -j2 - make install + make -j $(getconf _NPROCESSORS_ONLN) + make -j $(getconf _NPROCESSORS_ONLN) install - name: Get short SHA id: slug @@ -94,7 +94,7 @@ jobs: run: tar cvfz ${GITHUB_WORKSPACE}/openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_linux_amd64.tar.gz -C build-release/release/ . - name: Upload TGZ artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_linux_amd64 path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_linux_amd64.tar.gz @@ -111,7 +111,7 @@ jobs: desc: 'One Must Fall 2097 Remake' - name: Upload DEB artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_deb_amd64 path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_amd64.deb @@ -136,8 +136,8 @@ jobs: run: | mkdir build-release && cd build-release cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=release .. - make -j3 - make install + make -j $(getconf _NPROCESSORS_ONLN) + make -j $(getconf _NPROCESSORS_ONLN) install - name: Get short SHA id: slug @@ -149,11 +149,47 @@ jobs: zip -r ${GITHUB_WORKSPACE}/openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos12.zip . - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos12 path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos12.zip + build_macos-arm: + needs: [unittest, formatting-check] + + name: Build macos-14 + runs-on: macos-14 + + steps: + - uses: actions/checkout@v4 + + - name: Install Mac Dependencies + run: | + brew update + brew install cmake argtable cunit sdl2_mixer confuse enet sdl2 libxmp libpng + + - name: Generate Release + run: | + mkdir build-release && cd build-release + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=release .. + make -j $(getconf _NPROCESSORS_ONLN) + make -j $(getconf _NPROCESSORS_ONLN) install + + - name: Get short SHA + id: slug + run: echo "sha8=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_OUTPUT + + - name: Generate ZIP package + run: | + cd build-release/release + zip -r ${GITHUB_WORKSPACE}/openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos14_arm.zip . + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos14_arm + path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos14_arm.zip + # Build windows package, release artifact and update "latest" release if necessary. # ----------------------------------------------------------------------------------------------- build_windows: @@ -183,8 +219,8 @@ jobs: -DCMAKE_LIBRARY_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/lib/" \ -DCMAKE_FIND_ROOT_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/" \ "${GITHUB_WORKSPACE}" - make -j2 - make install + make -j $(getconf _NPROCESSORS_ONLN) + make -j $(getconf _NPROCESSORS_ONLN) install cp ${GITHUB_WORKSPACE}/openomf-win-build-main/bin/*.dll release/openomf/ - name: Get short SHA @@ -197,7 +233,7 @@ jobs: zip -r ${GITHUB_WORKSPACE}/openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_windows_amd64.zip openomf - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_windows_amd64 path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_windows_amd64.zip @@ -206,7 +242,7 @@ jobs: # Create a "latest" release # ----------------------------------------------------------------------------------------------- make_release: - needs: [build_windows, build_macos, build_ubuntu] + needs: [build_windows, build_macos, build_macos-arm, build_ubuntu] if: github.ref == 'refs/heads/master' name: Make "latest" release @@ -217,12 +253,12 @@ jobs: with: fetch-depth: '0' - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: path: artifacts/ - name: Advance tag - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}} script: |