From 1dbb7f5eb111004f5b7887fac2d91e9ac11f7238 Mon Sep 17 00:00:00 2001 From: Wojciech Jarosz Date: Wed, 6 Dec 2023 23:33:50 +0700 Subject: [PATCH] updating workflows --- .github/workflows/ci-emscripten.yml | 7 ++-- .github/workflows/ci-linux.yml | 13 ++++---- .github/workflows/ci-mac.yml | 52 +++++++++-------------------- .github/workflows/ci-windows.yml | 9 ++--- 4 files changed, 32 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci-emscripten.yml b/.github/workflows/ci-emscripten.yml index 1189204..5d016bb 100644 --- a/.github/workflows/ci-emscripten.yml +++ b/.github/workflows/ci-emscripten.yml @@ -1,10 +1,11 @@ name: Publish web app version to gh-pages on: - push: + pull_request: branches: - "*" - pull_request: + push: + branches: - "*" paths: # This action only runs on push when C++ files are changed @@ -28,6 +29,8 @@ jobs: run: brew install ninja emscripten - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: actions/cache@v3 with: diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 4a9ba52..92b76f0 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -1,10 +1,11 @@ name: Linux build on: - push: + pull_request: branches: - "*" - pull_request: + push: + branches: - "*" paths: # This action only runs on push when C++ files are changed @@ -25,9 +26,10 @@ jobs: strategy: fail-fast: false matrix: - buildtype: [Release, Debug] config: - - { name: "Ubuntu Latest", os: ubuntu-latest } + - { name: "Ubuntu 22.04", os: ubuntu-22.04 } + - { name: "Ubuntu 20.04", os: ubuntu-20.04 } + buildtype: [Release, Debug] steps: - name: Install dependencies @@ -44,7 +46,6 @@ jobs: # Setup caching of build artifacts to reduce total build time (only Linux and MacOS) - name: ccache - if: runner.os != 'Windows' uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ matrix.config.os }}-${{ matrix.buildtype }} @@ -66,6 +67,6 @@ jobs: - name: Archive build artifacts uses: actions/upload-artifact@v3 with: - name: linux-build-artifacts-${{ matrix.buildtype }} + name: build-artifacts-${{ matrix.config.os }}-${{ matrix.buildtype }} path: | ${{github.workspace}}/build/${{ matrix.buildtype }} diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml index 5ded126..b31c928 100644 --- a/.github/workflows/ci-mac.yml +++ b/.github/workflows/ci-mac.yml @@ -1,10 +1,11 @@ name: macOS build on: - push: + pull_request: branches: - "*" - pull_request: + push: + branches: - "*" paths: # This action only runs on push when C++ files are changed @@ -26,35 +27,13 @@ jobs: fail-fast: false matrix: config: - - { - name: "macOS 11 - OpenGL", - os: macos-11, - suffix: "-opengl", - cmake_options: '-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DNANOGUI_BACKEND=OpenGL -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"', - } - - { - name: "macOS 12 - OpenGL", - os: macos-12, - suffix: "-opengl", - cmake_options: '-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DNANOGUI_BACKEND=OpenGL -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"', - } - - { - name: "Ubuntu 22.04", - os: ubuntu-22.04, - suffix: "", - cmake_options: "", - } - - { - name: "Ubuntu 20.04", - os: ubuntu-20.04, - suffix: "", - cmake_options: "", - } + - { name: "macOS 11", os: macos-11 } + - { name: "macOS 12", os: macos-12 } buildtype: [Release, Debug] steps: - name: Install dependencies - run: ${{ runner.os == 'macOS' && 'brew install ninja create-dmg' || 'sudo apt-get update && sudo apt-get install cmake xorg-dev libglu1-mesa-dev zlib1g-dev libxrandr-dev ninja-build' }} + run: brew install ninja create-dmg - uses: actions/checkout@v3 with: @@ -76,34 +55,33 @@ jobs: - name: Configure CMake run: | - cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} -DCMAKE_POLICY_DEFAULT_CMP0135=NEW -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ${{ matrix.config.cmake_options }} + cmake -B ${{github.workspace}}/build/${{ matrix.buildtype }} -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} -DCMAKE_POLICY_DEFAULT_CMP0135=NEW -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" - name: Build - run: cmake --build ${{github.workspace}}/build --parallel 4 --config ${{ matrix.buildtype }} + run: cmake --build ${{github.workspace}}/build/${{ matrix.buildtype }} --parallel 4 --config ${{ matrix.buildtype }} - name: Checking that Samplin Safari runs - if: runner.os != 'Windows' run: | - ${{github.workspace}}/build/${{ runner.os == 'macOS' && 'Samplin\ Safari.app/Contents/MacOS/Samplin\ Safari' || 'Samplin\ Safari' }} --help + ${{github.workspace}}/build/${{ matrix.buildtype }}/Samplin\ Safari.app/Contents/MacOS/Samplin\ Safari --help - name: Creating dmg (macOS) if: runner.os == 'macOS' run: | - RESULT="${{github.workspace}}/build/SamplinSafari${{ matrix.config.suffix }}.dmg" + RESULT="${{github.workspace}}/build/${{ matrix.buildtype }}/SamplinSafari.dmg" test -f $RESULT && rm $RESULT - create-dmg --window-size 500 300 --icon-size 96 --volname "Samplin Safari Installer" --app-drop-link 360 105 --icon Samplin\ Safari.app 130 105 $RESULT ${{github.workspace}}/build/Samplin\ Safari.app + create-dmg --window-size 500 300 --icon-size 96 --volname "Samplin Safari Installer" --app-drop-link 360 105 --icon Samplin\ Safari.app 130 105 $RESULT ${{github.workspace}}/build/${{ matrix.buildtype }}/Samplin\ Safari.app - name: Archive dmg (macOS) if: runner.os == 'macOS' uses: actions/upload-artifact@v3 with: - name: SamplinSafari-${{ matrix.config.os }}${{ matrix.config.suffix }}-${{ matrix.buildtype }}.dmg + name: SamplinSafari-${{ matrix.config.os }}-${{ matrix.buildtype }}.dmg path: | - ${{github.workspace}}/build/SamplinSafari${{ matrix.config.suffix }}.dmg + ${{github.workspace}}/build/${{ matrix.buildtype }}/SamplinSafari.dmg - name: Archive build artifacts uses: actions/upload-artifact@v3 with: - name: build-artifacts-${{ matrix.config.os }}${{ matrix.config.suffix }}-${{ matrix.buildtype }} + name: build-artifacts-${{ matrix.config.os }}-${{ matrix.buildtype }} path: | - ${{github.workspace}}/build + ${{github.workspace}}/build/${{ matrix.buildtype }} diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 6d14f7d..0fc0fec 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -1,10 +1,11 @@ name: Windows build on: - push: + pull_request: branches: - "*" - pull_request: + push: + branches: - "*" paths: # This action only runs on push when C++ files are changed @@ -16,7 +17,7 @@ on: workflow_dispatch: jobs: - build_windows: + build: name: ${{ matrix.config.name }} (${{ matrix.buildtype }}) runs-on: ${{ matrix.config.os }} strategy: @@ -56,6 +57,6 @@ jobs: - name: Archive build artifacts uses: actions/upload-artifact@v3 with: - name: Samplin Safari + name: build-artifacts-${{ matrix.config.os }}-${{ matrix.buildtype }} path: | "${{github.workspace}}/build/${{ matrix.buildtype }}/Samplin Safari.exe"