Skip to content

Add workflow

Add workflow #1

Workflow file for this run

name: Build Project
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Build ${{ matrix.platform }} in ${{ matrix.build_type }}"
strategy:
matrix:
platform: [windows, ubuntu, macos]
build_type: [Debug, Release]
env:
PARALLEL: -j 2
runs-on: "${{ matrix.platform }}-latest"
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- if: ${{ matrix.platform == 'ubuntu' }}
name: Install RandR headers
run: |
sudo apt-get update
sudo apt install xorg-dev libglu1-mesa-dev
- if: ${{ matrix.platform == 'windows' }}
name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- if: ${{ matrix.platform == 'windows' }}
name: sccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.platform }}
variant: sccache
- if: ${{ matrix.platform != 'windows' }}
name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.platform }}
- if: ${{ matrix.platform == 'windows' }}
name: Configure and build
shell: pwsh
run: |
cmake -B"build/${{ matrix.platform }}" -G"NMake Makefiles" -DCMAKE_C_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache -DCMAKE_CXX_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache
cmake --build "build/${{ matrix.platform }}" --target comet --config ${{ matrix.build_type }} -j 1
- if: ${{ matrix.platform != 'windows' }}
name: Configure and build
run: |
cmake -B"build/${{ matrix.platform }}"
cmake --build "build/${{ matrix.platform }}" --target comet --config ${{ matrix.build_type }} ${{ env.PARALLEL }}