Skip to content

Commit

Permalink
Merge build and test jobs, upload built artifacts
Browse files Browse the repository at this point in the history
Signed-off-by: Martynas Gurskas <[email protected]>
  • Loading branch information
Lipt0nas committed Mar 13, 2024
1 parent 70580f7 commit e7059d6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,23 @@ env:

jobs:
build:
runs-on: ubuntu-latest
container:
image: rust:1.72-bullseye
steps:
- uses: actions/checkout@v3
- name: Build
run: |
cargo build --release --package uniffi-bindgen-cpp
test-bindings:
runs-on: ubuntu-latest
container:
image: ghcr.io/nordsecurity/uniffi-bindgen-cpp-test-runner:v0.3.0
steps:
- uses: actions/checkout@v3
- name: Test bindings
shell: bash
env:
# Github sets HOME to /github/home and breaks dependencies in Docker image..
# https://github.com/actions/runner/issues/863
HOME: /root
run: |
source ~/.bashrc
./test_bindings.sh
- name: Build bindgen
run: ./build_bindgen.sh
- name: Build bindings
run: ./build_bindings.sh
- name: Run tests
run: ./test_bindings.sh
- uses: actions/upload-artifact@v3
with:
name: scaffolding_lib
path: cpp-tests/build/libuniffi_fixtures.so

test-scaffolding-go:
test-scaffolding-go:
runs-on: ubuntu-latest
container:
image: ghcr.io/nordsecurity/uniffi-bindgen-cpp-test-runner:v0.3.0
Expand Down
4 changes: 4 additions & 0 deletions build_bindgen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -euxo pipefail

cargo build --release --package uniffi-bindgen-cpp
7 changes: 7 additions & 0 deletions build_bindings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -euxo pipefail

mkdir -p cpp-tests/build
cd cpp-tests/build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
3 changes: 0 additions & 3 deletions test_bindings.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash
set -euxo pipefail

mkdir -p cpp-tests/build
cd cpp-tests/build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
CTEST_OUTPUT_ON_FAILURE=1 make test

0 comments on commit e7059d6

Please sign in to comment.