-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actions: update workflow to use cmake
Additionally added a Windows arm64 build. Signed-off-by: Mahyar Koshkouei <[email protected]>
- Loading branch information
1 parent
60e4a31
commit 3773e48
Showing
2 changed files
with
86 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: build | ||
on: | ||
push: | ||
branches-ignore: | ||
- '**pages**' | ||
pull_request: | ||
branches-ignore: | ||
- '**pages**' | ||
|
||
env: | ||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.os }}-${{ matrix.build_type }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
build_type: [RelWithDebInfo] | ||
generator: [Ninja] | ||
include: | ||
- os: windows-2022 | ||
build_type: RelWithDebInfo | ||
generator: "Visual Studio 17 2022" | ||
arch: amd64 | ||
toolset: -T v143 | ||
- os: windows-2022 | ||
build_type: RelWithDebInfo | ||
generator: "Visual Studio 17 2022" | ||
arch: amd64_arm64 | ||
toolset: -T v143 | ||
- os: windows-2019 | ||
build_type: RelWithDebInfo | ||
generator: "Visual Studio 16 2019" | ||
arch: amd64_x86 | ||
toolset: -T v141_xp | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Initialise MSVC environment | ||
if: "contains(matrix.os, 'windows')" | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
|
||
- uses: lukka/get-cmake@latest | ||
|
||
- run: mkdir ${{ env.CPM_SOURCE_CACHE }} | ||
|
||
- name: Cache multiple paths | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ env.CPM_SOURCE_CACHE }} | ||
${{ github.workspace }}/build/_deps | ||
${{ github.workspace }}/build/**/cmake_pch.* | ||
key: ${{ matrix.os }}-${{ hashFiles('CMakeLists.txt','.github/workflows/build.yml') }} | ||
|
||
- name: Build | ||
run: | | ||
cmake -S . -B build -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.toolset }} | ||
cmake --build build | ||
- name: Tar output on Unix systems | ||
if: "contains(matrix.os, 'windows') == false" | ||
run: | | ||
cd ${{ github.workspace }}/build | ||
tar cf haiyajan.tar haiyajan* | ||
- name: Get Short SHA | ||
id: vars | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
|
||
- name: Upload output | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.os }}${{ matrix.arch}}-${{ matrix.build_type }}-${{ steps.vars.outputs.sha_short }} | ||
path: | | ||
${{ github.workspace }}/build/haiyajan.tar | ||
${{ github.workspace }}/build/**/haiyajan.exe | ||
${{ github.workspace }}/build/**/haiyajan.pdb |
This file was deleted.
Oops, something went wrong.