|
8 | 8 |
|
9 | 9 | jobs:
|
10 | 10 | linux:
|
11 |
| - runs-on: ${{ matrix.os }} |
| 11 | + runs-on: ${{ matrix.config.os }} |
12 | 12 |
|
13 | 13 | strategy:
|
14 | 14 | 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 |
16 | 24 |
|
17 | 25 | 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 |
20 | 41 |
|
21 | 42 | - name: Get current date
|
22 | 43 | id: date
|
23 | 44 | run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
|
24 | 45 |
|
25 | 46 | - name: Create Build Environment
|
26 |
| - run: cmake -E make_directory ${{runner.workspace}}/build |
| 47 | + run: cmake -E make_directory ${{github.workspace}}/build |
27 | 48 |
|
28 | 49 | - name: Configure CMake
|
29 | 50 | 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}} .. |
32 | 56 |
|
33 | 57 | - name: Build
|
34 |
| - working-directory: ${{runner.workspace}}/build |
| 58 | + working-directory: ${{github.workspace}}/build |
35 | 59 | shell: bash
|
36 | 60 | run: cmake --build . --config ${{env.BUILD_TYPE}}
|
37 | 61 |
|
38 |
| - - name: Test |
39 |
| - shell: bash |
40 |
| - run: ctest -C ${{env.BUILD_TYPE}} |
41 |
| - |
42 | 62 | - name: Status
|
43 |
| - uses: Sibz/github-status-action@v1 |
| 63 | + uses: brinkqiang/github-status-action@v2 |
44 | 64 | with:
|
45 | 65 | authToken: ${{secrets.GITHUB_TOKEN}}
|
46 | 66 | context: 'Set Status'
|
|
0 commit comments