-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (57 loc) · 1.42 KB
/
test.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
name: Run Tests
'on':
push:
branches:
- '**'
paths:
- src/**
- tests/**
- .github/workflows/test.yml
- .gitmodules
workflow_dispatch: ~
jobs:
unit-tests:
runs-on: ubuntu-latest
name: Run Unit Tests
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Compile and run unit tests
shell: bash
run: |
shopt -s globstar extglob
g++ -Og -Isrc tests/unit/**/*.cpp src/!(main).cpp
./a.out
cli-tests-unix:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
name: Run CLI Tests for ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build and run tests
shell: bash
run: "./clitest.sh\n"
cli-tests-windows:
runs-on: windows-latest
name: Run CLI Tests for Windows
steps:
- uses: actions/checkout@v4
- uses: ilammy/[email protected]
- name: Compile C++ sources
shell: pwsh
run: |
cl .\src\*.cpp /Od /EHs /std:c++20 /MTd /link /out:trilangle
- name: Run test scripts
# Screw it, I'm not figuring out how to make this work in PowerShell.
shell: bash
run: |
for script in tests/cli/*/index.sh
do
echo "Running ${script}..."
TRILANGLE=./trilangle "$script"
done