-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (92 loc) · 2.39 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
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
name: Tests
on:
push:
branches:
- main
paths:
- 'src/**'
- 'examples/**'
- 'CMakeLists.txt'
- '.github/workflows/test.yml'
pull_request:
paths:
- 'src/**'
- 'examples/**'
- 'CMakeLists.txt'
- '.github/workflows/test.yml'
workflow_dispatch:
jobs:
Brotli:
runs-on: ubuntu-latest
steps:
- name: Cache Brotli
id: cache
uses: actions/cache@v2
with:
path: ~/brotli-install
key: libbrotli
- name: Install Devtools
run: |
sudo apt-get update
sudo apt-get install -y git cmake clang
if: steps.cache.outputs.cache-hit != 'true'
- name: Checkout Brotli
run: |
cd ~
git clone https://github.com/google/brotli
if: steps.cache.outputs.cache-hit != 'true'
- name: Build Brotli
run: |
cd ~/brotli
git checkout v1.0.9
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=~/brotli-install ..
make -j2
make install
if: steps.cache.outputs.cache-hit != 'true'
Test:
runs-on: ubuntu-latest
needs: Brotli
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Clang
uses: egor-tensin/setup-clang@v1
with:
version: 16
platform: x64
- name: Setup CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.26.0'
- name: Get Brotli
uses: actions/cache@v2
with:
path: ~/brotli-install
key: libbrotli
- name: Install Brotli
run: |
cd ~/brotli-install
ls
sudo cp -r include/* /usr/include/
sudo cp -r lib/*.a /usr/lib/
- name: Build
run: |
cd $GITHUB_WORKSPACE
mkdir build
mkdir build/flame-route
cd build
CXX=clang++ CC=clang cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=flame-route ..
make -j2
- name: Test
run: |
bash test/test.sh || exit 1
- name: Generate Artifact
run: |
cd build
make install
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: flame-route
path: build/flame-route