|
10 | 10 | CARGO_TERM_COLOR: always
|
11 | 11 |
|
12 | 12 | jobs:
|
13 |
| - build-scaffolding: |
| 13 | + run-tests: |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + # TODO: remove this when the workflow is stable |
| 17 | + fail-fast: false |
| 18 | + |
| 19 | + matrix: |
| 20 | + # Ubuntu-20.04 is being used here on purpose instead of ubuntu-latest due to a bug with clang and libstdc++ |
| 21 | + # https://github.com/actions/runner-images/issues/8659 |
| 22 | + os: [ubuntu-20.04, windows-latest] |
| 23 | + build_type: [Release] |
| 24 | + cpp_compiler: [g++, clang++, cl] |
| 25 | + exclude: |
| 26 | + - os: windows-latest |
| 27 | + cpp_compiler: g++ |
| 28 | + - os: windows-latest |
| 29 | + cpp_compiler: clang++ |
| 30 | + - os: ubuntu-20.04 |
| 31 | + cpp_compiler: cl |
| 32 | + |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + |
| 36 | + - name: Set reusable strings |
| 37 | + id: strings |
| 38 | + shell: bash |
| 39 | + run: | |
| 40 | + echo "build-output-dir=${{ github.workspace }}/cpp-tests/build" >> "$GITHUB_OUTPUT" |
| 41 | + echo "build-source-dir=${{ github.workspace }}/cpp-tests" >> "$GITHUB_OUTPUT" |
| 42 | +
|
| 43 | + - name: Install additional dependencies |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + if [ "$RUNNER_OS" == "Linux" ]; then |
| 47 | + sudo apt update && sudo apt install -y valgrind |
| 48 | + fi |
| 49 | +
|
| 50 | + - name: Configure CMake |
| 51 | + run: > |
| 52 | + cmake -B ${{ steps.strings.outputs.build-output-dir }} |
| 53 | + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
| 54 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} |
| 55 | + -S ${{ steps.strings.outputs.build-source-dir }} |
| 56 | + - name: Build |
| 57 | + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} |
| 58 | + |
| 59 | + - name: Run tests |
| 60 | + working-directory: ${{ steps.strings.outputs.build-output-dir }} |
| 61 | + run: ctest --build-config ${{ matrix.build_type }} |
| 62 | + |
| 63 | + build-scaffolding-lib: |
14 | 64 | runs-on: ubuntu-latest
|
15 | 65 | container:
|
16 | 66 | image: ghcr.io/nordsecurity/uniffi-bindgen-cpp-test-runner:v0.3.0
|
17 | 67 | steps:
|
18 | 68 | - uses: actions/checkout@v3
|
19 |
| - - name: Build scaffolding |
| 69 | + |
| 70 | + - name: Build scaffolding library |
20 | 71 | shell: bash
|
21 | 72 | env:
|
22 | 73 | # Github sets HOME to /github/home and breaks dependencies in Docker image..
|
23 | 74 | # https://github.com/actions/runner/issues/863
|
24 | 75 | HOME: /root
|
25 | 76 | run: |
|
26 | 77 | source ~/.bashrc
|
27 |
| - ./build_bindgen.sh |
28 |
| - ./build_scaffolding.sh |
| 78 | + ./build_scaffolding_lib.sh |
29 | 79 | - uses: actions/upload-artifact@v3
|
30 | 80 | with:
|
31 | 81 | name: scaffolding_lib
|
32 | 82 | path: cpp-tests/build/libuniffi_fixtures.so
|
33 | 83 |
|
34 |
| - run-tests: |
35 |
| - runs-on: ubuntu-latest |
36 |
| - container: |
37 |
| - image: ghcr.io/nordsecurity/uniffi-bindgen-cpp-test-runner:v0.3.0 |
38 |
| - steps: |
39 |
| - - uses: actions/checkout@v3 |
40 |
| - - name: Run tests |
41 |
| - shell: bash |
42 |
| - env: |
43 |
| - HOME: /root |
44 |
| - run: | |
45 |
| - source ~/.bashrc |
46 |
| - ./build_bindgen.sh |
47 |
| - ./test_bindings.sh |
48 |
| -
|
49 | 84 | test-scaffolding-go:
|
50 | 85 | runs-on: ubuntu-latest
|
51 | 86 | container:
|
52 | 87 | image: ghcr.io/nordsecurity/uniffi-bindgen-cpp-test-runner:v0.3.0
|
53 |
| - needs: build-scaffolding |
| 88 | + needs: build-scaffolding-lib |
54 | 89 | steps:
|
55 | 90 | - uses: actions/checkout@v3
|
56 | 91 | with:
|
|
71 | 106 | runs-on: ubuntu-latest
|
72 | 107 | container:
|
73 | 108 | image: ghcr.io/nordsecurity/uniffi-bindgen-cs-test-runner:v0.1.0
|
74 |
| - needs: build-scaffolding |
| 109 | + needs: build-scaffolding-lib |
75 | 110 | steps:
|
76 | 111 | - uses: actions/checkout@v3
|
77 | 112 | with:
|
|
0 commit comments