-
Notifications
You must be signed in to change notification settings - Fork 13
72 lines (61 loc) · 1.92 KB
/
ci.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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
strategy:
matrix:
os: [ubuntu-22.04, macos-12, macos-14, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install ninja
shell: bash
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
brew install ninja
elif [[ "${{ runner.os }}" == "Linux" ]]; then
sudo apt-get -y update
sudo apt-get -y install ninja-build
fi
- name: Build
if: matrix.os != 'windows-2022'
run: |
cmake -Bbuild -S. -GNinja
ninja -Cbuild
- name: Build
if: matrix.os == 'windows-2022'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake -Bbuild -S. -GNinja
ninja -Cbuild
- name: Test
run: |
cd build/castxml-prefix/src/castxml-build
ctest --output-on-failure
- name: Create archive for Windows
if: matrix.os == 'windows-2022'
shell: cmd
run: |
cd build
7z a castxml-${{ matrix.os }}.zip castxml
move castxml-${{ matrix.os }}.zip ..
- name: Create archive for macOS and Ubuntu
if: matrix.os != 'windows-2022'
shell: bash
run: |
cd build
tar cvf castxml-${{ matrix.os }}.tar castxml
gzip -9 castxml-${{ matrix.os }}.tar
mv castxml-${{ matrix.os }}.tar.gz ..
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-archive
path: ./castxml-${{ matrix.os }}.*