Skip to content

Commit

Permalink
dev: add github ci action
Browse files Browse the repository at this point in the history
  • Loading branch information
jyxiong authored Sep 10, 2024
1 parent 717755a commit 96b0017
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Project

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master, dev]

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]
build_type: [Debug, Release]
env:
PARALLEL: -j 2
runs-on: "${{ matrix.platform }}-latest"
steps:
- uses: actions/checkout@v4
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.os }}
variant: sccache
- if: ${{ matrix.platform != 'windows' }}
name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}
- if: ${{ matrix.platform == 'windows' }}
name: Configure and build
shell: pwsh
run: |
cmake -B"build/${{ matrix.platform }}" -G"Ninja" -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 prism --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 prism --config ${{ matrix.build_type }} ${{ env.PARALLEL }}

0 comments on commit 96b0017

Please sign in to comment.