-
Notifications
You must be signed in to change notification settings - Fork 9
140 lines (125 loc) · 3.76 KB
/
main.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Continuous Integration
on:
push:
branches: [ "main" ]
tags-ignore: ['*']
paths-ignore: ['**.md']
pull_request:
branches: [ "main" ]
paths-ignore: ['**.md']
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
strategy:
fail-fast: false
matrix:
config:
- {
name: Linux GCC,
os: ubuntu-latest,
compiler: gcc,
shell: bash,
}
- {
name: macOS Clang,
os: macos-latest,
compiler: clang,
shell: bash,
}
- {
name: MSYS2 UCRT64,
os: windows-latest,
compiler: gcc,
shell: 'msys2 {0}',
msystem: ucrt64,
msys-env: mingw-w64-ucrt-x86_64,
}
steps:
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
cmake \
libsdl2-dev \
libsdl2-mixer-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
brew update || true
brew install \
cmake \
sdl2 \
sdl2_mixer
- name: Install dependencies (MSYS2)
if: matrix.config.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
update: false
install: >-
${{ matrix.config.msys-env }}-gcc
${{ matrix.config.msys-env }}-cmake
${{ matrix.config.msys-env }}-SDL2
${{ matrix.config.msys-env }}-SDL2_mixer
- uses: actions/checkout@v3
- name: Build shareware executable
env:
CC: ${{ matrix.config.compiler }}
CFLAGS: -Wall
run: |
cmake -E make_directory cmake-build
cmake -S . -B cmake-build --fresh -DTARADINO_SHAREWARE=ON -DTARADINO_WERROR=OFF -DTARADINO_SUFFIX=shareware
cmake --build cmake-build --config Release
- name: Build registered executable
env:
CC: ${{ matrix.config.compiler }}
CFLAGS: -Wall
run: |
cmake -E make_directory cmake-build
cmake -S . -B cmake-build --fresh -DTARADINO_SHAREWARE=OFF -DTARADINO_WERROR=ON -UTARADINO_SUFFIX
cmake --build cmake-build --config Release
- name: Upload artifacts (Windows)
uses: actions/upload-artifact@v3
if: runner.os == 'Windows'
with:
name: taradino-${{ github.sha }}-win64
path: |
cmake-build/taradino.exe
cmake-build/taradino_shareware.exe
- name: Upload artifacts (Linux)
uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
with:
name: taradino-${{ github.sha }}-Linux
path: |
cmake-build/taradino
cmake-build/taradino_shareware
- name: Upload artifacts (macOS)
uses: actions/upload-artifact@v3
if: runner.os == 'macOS'
with:
name: taradino-${{ github.sha }}-macOS
path: |
cmake-build/taradino
cmake-build/taradino_shareware
cppcheck:
name: Cppcheck
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install cppcheck
- uses: actions/checkout@v3
- name: Run cppcheck
shell: bash
run: |
cppcheck --version
cppcheck --error-exitcode=1 -j4 -q --force -U_WIN32 -U__APPLE__ -Irott rott