-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (64 loc) · 1.8 KB
/
test.yml
File metadata and controls
72 lines (64 loc) · 1.8 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
name: Test
on:
push:
branches: ["main"]
paths:
- ".github/workflows/**"
- "src/**"
- "tests/**"
- "Makefile"
pull_request:
branches: ["main"]
paths:
- ".github/workflows/**"
- "src/**"
- "tests/**"
- "Makefile"
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
build: [release, debug]
steps:
- name: Show OS info
run: |
echo "OS details:"
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
lsb_release -a || cat /etc/os-release
else
sw_vers
fi
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up C++ environment
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt-get update
sudo apt-get install -y build-essential
fi
- name: Show build info
run: |
echo "Operating System: ${{ matrix.os }}"
echo "Build type: ${{ matrix.build }}"
if [ "${{ matrix.os }}" = "macos-latest" ]; then
echo "Using C++ standard: c++2b (macOS clang compatibility)"
else
echo "Using C++ standard: c++23 (Linux default)"
fi
- name: Build
run: |
if [ "${{ matrix.os }}" = "macos-latest" ]; then
CXX_STANDARD=c++2b
else
CXX_STANDARD=c++23
fi
echo "Building ${{ matrix.build }} with CXX_STANDARD=$CXX_STANDARD " \
"on ${{ matrix.os }}"
make CXX_STANDARD=$CXX_STANDARD ${{ matrix.build }}
- name: Test
run: |
echo "Testing ${{ matrix.build }} on ${{ matrix.os }}"
make test-${{ matrix.build }}