Skip to content

Lib

Lib #62

Workflow file for this run

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: Check Cache
id: cache
uses: actions/cache@v2
with:
path: ~/brotli-install
key: libbrotli
# if cache exists, exit job
- name: Check Cache Hit
run: exit 0
if: steps.cache.outputs.cache-hit == 'true'
- name: Install Devtools
run: |
sudo apt-get update
sudo apt-get install -y git cmake clang
- name: Checkout Brotli
run: |
cd ~
git clone https://github.com/google/brotli
- 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
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/actions-setup-cmake@v1.13
with:
cmake-version: '3.26.0'
- name: Get Brotli
uses: actions/cache@v2
with:
path: ~/brotli
key: libbrotli
- name: Install Brotli
run: |
cd ~/brotli
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