Skip to content

Commit 4fed9ea

Browse files
author
Dongsheng He
committed
support-github-workflow
1 parent 703bd01 commit 4fed9ea

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: ci
2+
on: [push, pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
build-and-test:
9+
name: >-
10+
CI
11+
${{ matrix.os }}
12+
${{ matrix.compiler }}
13+
${{ matrix.optimized && 'release' }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
compiler: [clang]
19+
os: [ubuntu-latest, macos-latest]
20+
optimized: [true]
21+
include:
22+
- compiler: clang
23+
CC: clang
24+
CXX: clang++
25+
26+
env:
27+
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
28+
CMAKE_BUILD_TYPE: ${{ matrix.optimized && 'RelWithDebInfo'}}
29+
CC: ${{ matrix.CC }}
30+
CXX: ${{ matrix.CXX }}
31+
BINARY_SUFFIX: ${{ startsWith(matrix.os, 'windows') && '.exe' || '' }}
32+
BINARY_PATH: >-
33+
${{ format(
34+
startsWith(matrix.os, 'windows') && '{0}\build\{1}\' || '{0}/build/',
35+
github.workspace,
36+
matrix.optimized && 'RelWithDebInfo' || 'Debug') }}
37+
38+
steps:
39+
- uses: actions/checkout@v2
40+
with:
41+
submodules: true
42+
43+
- name: Install dependencies on Linux
44+
if: ${{ runner.os == 'Linux' }}
45+
# libgoogle-perftools-dev is temporarily removed from the package list
46+
# because it is currently broken on GitHub's Ubuntu 22.04.
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install libkyotocabinet-dev libsnappy-dev libsqlite3-dev
50+
51+
- name: Generate build config
52+
run: >-
53+
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}"
54+
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
55+
-DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/install_test/
56+
57+
- name: Build
58+
run: >-
59+
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
60+
--config "${{ env.CMAKE_BUILD_TYPE }}"
61+
62+
- name: Run Tests
63+
working-directory: ${{ github.workspace }}/build
64+
run: ./db_test

0 commit comments

Comments
 (0)