-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (71 loc) · 1.97 KB
/
c-cpp.yml
File metadata and controls
74 lines (71 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: C/C++ CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
host: linux
- os: windows-latest
host: windows
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install Qt (Linux)
uses: jurplel/install-qt-action@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
version: '5.12.8'
host: ${{ matrix.host }}
cache: true
- name: Install Qt (Windows)
uses: jurplel/install-qt-action@v3
if: ${{ matrix.os == 'windows-latest' }}
with:
version: '5.12.8'
host: ${{ matrix.host }}
cache: true
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@latest
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v3
with:
key: llvm-15
path: |
C:/Program Files/LLVM
./llvm
- name: Get Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: '15'
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Compile
run: |
mkdir -p build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang '-DCMAKE_CXX_COMPILER=clang++' -G Ninja -DIS_BUILD_GUI:BOOL=ON -S . -B build
cmake --build build
- name: Run tests (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
chmod +x ./build/test/test_main
./build/test/test_main
- name: Run tests (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
.\build\test\test_main.exe
shell: pwsh
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/src/fillgame_gui*