Skip to content

Commit 63414d5

Browse files
committed
add
1 parent 4d19625 commit 63414d5

File tree

3 files changed

+90
-41
lines changed

3 files changed

+90
-41
lines changed

.github/workflows/linux.yml

+33-13
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,59 @@ env:
88

99
jobs:
1010
linux:
11-
runs-on: ${{ matrix.os }}
11+
runs-on: ${{ matrix.config.os }}
1212

1313
strategy:
1414
matrix:
15-
os: [ubuntu-latest]
15+
config:
16+
- os: ubuntu-latest
17+
cc: gcc
18+
cxx: g++
19+
vcpkg_triplet: x64-linux
20+
- os: ubuntu-latest
21+
cc: clang
22+
cxx: clang++
23+
vcpkg_triplet: x64-linux
1624

1725
steps:
18-
- uses: actions/checkout@v2
19-
- uses: lukka/get-cmake@latest
26+
- uses: actions/checkout@v4
27+
- uses: brinkqiang/get-cmake@v1
28+
29+
#- name: Install dependencies
30+
# run: sudo apt-get update && sudo apt-get install -y pkg-config
31+
32+
- name: vcpkg build
33+
uses: brinkqiang/vcpkg-action@v1
34+
id: vcpkg
35+
with:
36+
pkgs: gtest
37+
triplet: ${{ matrix.config.vcpkg_triplet }}
38+
cache-key: ${{ matrix.config.os }}
39+
token: ${{ github.token }}
40+
github-binarycache: true
2041

2142
- name: Get current date
2243
id: date
2344
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
2445

2546
- name: Create Build Environment
26-
run: cmake -E make_directory ${{runner.workspace}}/build
47+
run: cmake -E make_directory ${{github.workspace}}/build
2748

2849
- name: Configure CMake
2950
shell: bash
30-
working-directory: ${{runner.workspace}}/build
31-
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
51+
working-directory: ${{github.workspace}}/build
52+
env:
53+
CC: ${{ matrix.config.cc }}
54+
CXX: ${{ matrix.config.cxx }}
55+
run: cmake -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.config.vcpkg_triplet }} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ..
3256

3357
- name: Build
34-
working-directory: ${{runner.workspace}}/build
58+
working-directory: ${{github.workspace}}/build
3559
shell: bash
3660
run: cmake --build . --config ${{env.BUILD_TYPE}}
3761

38-
- name: Test
39-
shell: bash
40-
run: ctest -C ${{env.BUILD_TYPE}}
41-
4262
- name: Status
43-
uses: Sibz/github-status-action@v1
63+
uses: brinkqiang/github-status-action@v2
4464
with:
4565
authToken: ${{secrets.GITHUB_TOKEN}}
4666
context: 'Set Status'

.github/workflows/mac.yml

+29-13
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,55 @@ env:
88

99
jobs:
1010
mac:
11-
runs-on: ${{ matrix.os }}
11+
runs-on: ${{ matrix.config.os }}
1212

1313
strategy:
1414
matrix:
15-
os: [macos-latest]
15+
config:
16+
- os: macos-latest
17+
cc: gcc
18+
cxx: g++
19+
vcpkg_triplet: arm64-osx
20+
- os: macos-latest
21+
cc: clang
22+
cxx: clang++
23+
vcpkg_triplet: arm64-osx
1624

1725
steps:
18-
- uses: actions/checkout@v2
19-
- uses: lukka/get-cmake@latest
26+
- uses: actions/checkout@v4
27+
- uses: brinkqiang/get-cmake@v1
28+
- name: vcpkg build
29+
uses: brinkqiang/vcpkg-action@v1
30+
id: vcpkg
31+
with:
32+
pkgs: gtest
33+
triplet: ${{ matrix.config.vcpkg_triplet }}
34+
cache-key: ${{ matrix.config.os }}
35+
token: ${{ github.token }}
36+
github-binarycache: true
2037

2138
- name: Get current date
2239
id: date
2340
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
2441

2542
- name: Create Build Environment
26-
run: cmake -E make_directory ${{runner.workspace}}/build
43+
run: cmake -E make_directory ${{github.workspace}}/build
2744

2845
- name: Configure CMake
2946
shell: bash
30-
working-directory: ${{runner.workspace}}/build
31-
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
47+
working-directory: ${{github.workspace}}/build
48+
env:
49+
CC: ${{ matrix.config.cc }}
50+
CXX: ${{ matrix.config.cxx }}
51+
run: cmake -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.config.vcpkg_triplet }} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ..
3252

3353
- name: Build
34-
working-directory: ${{runner.workspace}}/build
54+
working-directory: ${{github.workspace}}/build
3555
shell: bash
3656
run: cmake --build . --config ${{env.BUILD_TYPE}}
3757

38-
- name: Test
39-
shell: bash
40-
run: ctest -C ${{env.BUILD_TYPE}}
41-
4258
- name: Status
43-
uses: Sibz/github-status-action@v1
59+
uses: brinkqiang/github-status-action@v2
4460
with:
4561
authToken: ${{secrets.GITHUB_TOKEN}}
4662
context: 'Set Status'

.github/workflows/win.yml

+28-15
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,56 @@ env:
88

99
jobs:
1010
win:
11-
runs-on: ${{ matrix.os }}
11+
runs-on: ${{ matrix.config.os }}
1212

1313
strategy:
1414
matrix:
15-
os: [windows-latest]
16-
visual_studio: ["Visual Studio 16 2019", "Visual Studio 17 2022"]
15+
config:
16+
- os: windows-latest
17+
compiler: msvc2019
18+
vcpkg_triplet: x64-windows
19+
- os: windows-latest
20+
compiler: msvc2022
21+
vcpkg_triplet: x64-windows
22+
- os: windows-latest
23+
compiler: clang-cl
24+
flags: -T ClangCL
25+
vcpkg_triplet: x64-windows
1726

1827
steps:
19-
- uses: actions/checkout@v2
20-
- uses: lukka/get-cmake@latest
28+
- uses: actions/checkout@v4
29+
- uses: brinkqiang/get-cmake@v1
30+
- name: vcpkg build
31+
uses: brinkqiang/vcpkg-action@v1
32+
id: vcpkg
33+
with:
34+
pkgs: gtest
35+
triplet: ${{ matrix.config.vcpkg_triplet }}
36+
cache-key: ${{ matrix.config.os }}
37+
token: ${{ github.token }}
38+
github-binarycache: true
2139

2240
- name: Get current date
2341
id: date
2442
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
2543

2644
- name: Create Build Environment
27-
run: cmake -E make_directory ${{runner.workspace}}/build
45+
run: cmake -E make_directory ${{github.workspace}}\build
2846

2947
- name: Configure CMake
3048
shell: bash
31-
working-directory: ${{runner.workspace}}/build
32-
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
49+
working-directory: ${{github.workspace}}\build
50+
run: cmake -DCMAKE_TOOLCHAIN_FILE=..\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.config.vcpkg_triplet }} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{matrix.config.flags}} ..
3351

3452
- name: Build
35-
working-directory: ${{runner.workspace}}/build
53+
working-directory: ${{github.workspace}}\build
3654
shell: bash
3755
run: cmake --build . --config ${{env.BUILD_TYPE}}
3856

39-
- name: Test
40-
shell: bash
41-
run: ctest -C ${{env.BUILD_TYPE}}
42-
4357
- name: Status
44-
uses: Sibz/github-status-action@v1
58+
uses: brinkqiang/github-status-action@v2
4559
with:
4660
authToken: ${{secrets.GITHUB_TOKEN}}
4761
context: 'Set Status'
4862
description: 'Passed'
4963
state: 'success'
50-

0 commit comments

Comments
 (0)