-
Notifications
You must be signed in to change notification settings - Fork 94
75 lines (75 loc) · 2.25 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
73
74
75
name: C SDK CI
on:
push:
pull_request:
jobs:
linux:
name: CI Test On Linux
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.13.0'
- name: Install dependencies
run: |
sudo apt install -yqq libcurl4 libcurl4-openssl-dev build-essential
- name: Build
run: |
set -e
cmake -S . -B build
cmake --build build -j $(nproc)
- name: Unit test
working-directory: '${{ github.workspace }}/build/gtests'
run: |
./qiniu_test --gtest_filter="UnitTest.*"
macos:
name: CI Test On macOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
brew install curl cmake make
- name: Build
run: |
set -e
cmake -DOPENSSL_ROOT_DIR="$(brew --prefix)/opt/openssl/" -S . -B build
cmake --build build -j $(nproc)
- name: Unit test
working-directory: '${{ github.workspace }}/build/gtests'
run: |
./qiniu_test --gtest_filter="UnitTest.*"
windows:
name: CI Test On Windows
runs-on: windows-latest
env:
buildDir: '${{ github.workspace }}/build/'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Visual Studio Dev cmds
uses: ilammy/msvc-dev-cmd@v1
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Install vcpkg
uses: lukka/[email protected]
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
vcpkgJsonGlob: 'vcpkg.json'
- name: Cmake
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtBasic
cmakeListsTxtPath: '${{ github.workspace }}\CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: ${{ env.buildDir }}
- name: Unit Test
run: |
./gtests/qiniu_test.exe --gtest_filter="UnitTest.*"
shell: bash
working-directory: ${{ env.buildDir }}