-
Notifications
You must be signed in to change notification settings - Fork 82
119 lines (101 loc) · 3.19 KB
/
make-test-multi-platform.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
# Source: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Tests on multiple platforms
on:
push:
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
compiler: ""
- os: ubuntu-latest
compiler: gcc
- os: ubuntu-latest
compiler: clang
- os: macos-latest
compiler: clang
- os: macos-14
compiler: clang
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os == 'windows-latest' }}
- name: Build and run tests (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
wmic cpu
nmake -f Makefile.win64
Get-ChildItem "." -Filter '*.exe' |
Foreach-Object {
Write-Output "--- RUNNING $_ ---"
Invoke-Expression $_
Write-Output "--- done RUNNING $_ ---"
}
working-directory: ${{ github.workspace }}/test
shell: pwsh
- name: Build and run tests (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
lscpu
make -f Makefile.linux64.${{ matrix.compiler }}
compiler=${{ matrix.compiler }}
for f in $(find . -type f -name "*.cpp"); do
if [[ -z "${f##*win.cpp}" ]]; then
continue
fi
f=${f%.cpp}
if [ ${compiler}="clang" ] && [[ $f == *virtual* ]]; then
continue
fi
echo "--- RUNNING $f ---"
${f}
echo "--- done RUNNING $f ---"
done
working-directory: ${{ github.workspace }}/test
- name: Build and run tests (Macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
sysctl hw
make -f Makefile.linux64.clang
compiler=clang
for f in $(find . -type f -name "*.cpp"); do
if [[ -z "${f##*win.cpp}" ]]; then
continue
fi
f=${f%.cpp}
if [ ${compiler}="clang" ] && [[ $f == *virtual* ]]; then
continue
fi
echo "--- RUNNING $f ---"
printf '\x07' | dd of=${f} bs=1 seek=160 count=1 conv=notrunc
${f}
echo "--- done RUNNING $f ---"
done
working-directory: ${{ github.workspace }}/test
- name: Build and run tests (Macos M1)
if: ${{ matrix.os == 'macos-14' }}
run: |
sysctl hw
make -f Makefile.linux64.clang
compiler=clang
for f in $(find . -type f -name "*.cpp"); do
if [[ -z "${f##*win.cpp}" ]]; then
continue
fi
f=${f%.cpp}
if [ ${compiler}="clang" ] && [[ $f == *virtual* ]]; then
continue
fi
echo "--- RUNNING $f ---"
printf '\x07' | dd of=${f} bs=1 seek=160 count=1 conv=notrunc
${f}
echo "--- done RUNNING $f ---"
done
working-directory: ${{ github.workspace }}/test
shell: bash