-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.25 KB
/
Build.yml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build
on:
push:
paths:
- '.github/workflows/Build.yml'
- '.github/workflows/CodeQL.yml'
- '.github/workflows/Test.yml'
- 'CMake**'
- 'Libs/**'
- 'Source/**.cpp'
- 'Source/**.hpp'
- 'Test/**'
- '**.cmake'
- '**.g4'
pull_request:
paths:
- '.github/workflows/Build.yml'
- '.github/workflows/CodeQL.yml'
- '.github/workflows/Test.yml'
- 'CMake**'
- 'Libs/**'
- 'Source/**.cpp'
- 'Source/**.hpp'
- 'Test/**'
- '**.cmake'
- '**.g4'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
defaults:
run:
shell: bash
env:
GHA_BUILD_DIR: "Build"
GHA_BUILD_CFG: "Release"
jobs:
Build:
runs-on: ${{ matrix.cfg.os }}
name: ${{ matrix.cfg.name }}
strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-latest, name: GCC, cc: gcc, cxx: g++, artifacts-dir: prs-linux }
- { os: ubuntu-latest, name: Clang, cc: clang, cxx: clang++, artifacts-dir: false }
- { os: windows-2019, name: VS2019, cc: cl, cxx: cl, artifacts-dir: false }
- { os: windows-2022, name: VS2022, cc: cl, cxx: cl, artifacts-dir: prs-windows }
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Java setup
if: runner.os == 'Windows'
uses: actions/setup-java@v3
with:
java-version: 16
distribution: 'microsoft'
- name: Build configuration
run: cmake -B ${{ env.GHA_BUILD_DIR }}
env:
CC: ${{ matrix.cfg.cc }}
CXX: ${{ matrix.cfg.cxx }}
ARTIFACTS_DIR: ${{ matrix.cfg.artifacts-dir }}
- name: Build
run: cmake --build ${{ env.GHA_BUILD_DIR }} --config ${{ env.GHA_BUILD_CFG }}
- name: Upload artifacts
if: ${{ matrix.cfg.artifacts-dir }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.cfg.artifacts-dir }}
path: ${{ matrix.cfg.artifacts-dir }}/
retention-days: 7
if-no-files-found: error
# note to self: GitHub UI ignores reusable workflow name and uses job name below instead
Test:
needs: Build
uses: ./.github/workflows/Test.yml
CodeQL:
needs: Build
uses: ./.github/workflows/CodeQL.yml
permissions:
security-events: write