-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (120 loc) · 3.76 KB
/
build_ship.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Build and Ship
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
jobs:
clang-format:
runs-on: ubuntu-22.04
steps:
- name : Checkout Source
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y clang-format
- name: Run Formatting
run: clang-format -i include/* src/*.c src/*.h
- name: Check Formatting
run: git diff --exit-code
build-linux:
name: build-${{ matrix.os }}-${{ matrix.cc }}
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
strategy:
fail-fast: false
matrix:
cc: ["gcc", "clang"]
os: ["ubuntu-latest"]
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Dependencies
run: sudo apt-get install -y libjansson-dev zlib1g-dev libzstd-dev
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug -DLIBTMJ_TEST=ON -DLIBTMJ_ZSTD=ON -DLIBTMJ_ZLIB=ON .
- name: Build
run: cmake --build .
- name: Test
run: ctest
- name: Create libtmj Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.cc }}-libtmj-master
path: lib/*
if-no-files-found: error
retention-days: 1
build-macos-latest-clang:
runs-on: macos-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Dependencies
run: brew install jansson zlib zstd
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug -DLIBTMJ_TEST=ON -DLIBTMJ_ZSTD=ON -DLIBTMJ_ZLIB=ON .
- name: Build
run: cmake --build .
- name: Test
run: ctest
- name: Create libtmj Artifact
uses: actions/upload-artifact@v4
with:
name: macos-latest-clang-libtmj-master
path: lib/*
if-no-files-found: error
retention-days: 1
build-windows-latest-msvc:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install dependencies
run: vcpkg install jansson:x64-windows zstd:x64-windows zlib:x64-windows
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug -DLIBTMJ_TEST=ON -DLIBTMJ_ZSTD=ON -DLIBTMJ_ZLIB=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake .
- name: Build
run: cmake --build . --config Debug
- name: Test
run: ctest -C Debug
- name: Create libtmj Artifact
uses: actions/upload-artifact@v4
with:
name: windows-latest-msvc-libtmj-master
path: lib/*
if-no-files-found: error
retention-days: 1
Pages:
needs: [build-linux, build-windows-latest-msvc] #, build-macos-clang]
permissions:
pages: write
id-token: write
environment:
name: github-pages
#url: ${{ steps.deployment.outputs.page_url }}
url: https://zer0-one.github.io/libtmj/
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: sudo apt-get install -y graphviz doxygen libjansson-dev zlib1g-dev libzstd-dev
- name: Checkout source
uses: actions/checkout@v4
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Release -DLIBTMJ_DOCS=ON -DLIBTMJ_ZSTD=ON -DLIBTMJ_ZLIB=ON .
- name: Build Docs
run: cmake --build .
- name: Create Docs Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/html/
- name: Publish Documentation
uses: actions/deploy-pages@v4