Skip to content

Commit

Permalink
updating workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
wkjarosz committed Dec 6, 2023
1 parent 64a36c2 commit 1dbb7f5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 49 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci-emscripten.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -28,6 +29,8 @@ jobs:
run: brew install ninja emscripten

- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/cache@v3
with:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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/[email protected]
with:
key: ${{ matrix.config.os }}-${{ matrix.buildtype }}
Expand All @@ -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 }}
52 changes: 15 additions & 37 deletions .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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 }}
9 changes: 5 additions & 4 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,7 +17,7 @@ on:
workflow_dispatch:

jobs:
build_windows:
build:
name: ${{ matrix.config.name }} (${{ matrix.buildtype }})
runs-on: ${{ matrix.config.os }}
strategy:
Expand Down Expand Up @@ -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"

0 comments on commit 1dbb7f5

Please sign in to comment.