-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding workflow to build and test (#56)
* Adding workflow to build and test * remove cargo stuff that is not needed * more changes to get conan installed * cancel any in progress so that it is more efficient * remove concurrency, not working * only trigger for push on main * Add conan profile support * retrigger CI * fix detect of profile
- Loading branch information
Steven Hartley
authored
Feb 26, 2024
1 parent
aa590f4
commit 3524f35
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: ["**"] | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Conan | ||
id: conan | ||
uses: turtlebrowser/get-conan@main | ||
|
||
- name: Conan version | ||
run: echo "${{ steps.conan.outputs.version }}" | ||
|
||
|
||
- name: Create default Conan profile | ||
run: conan profile detect | ||
|
||
- name: Install Rust toolchain | ||
run: rustup component add rustfmt clippy | ||
|
||
- name: Build and install Zenoh-c | ||
shell: bash | ||
run: | | ||
git clone https://github.com/eclipse-zenoh/zenoh-c.git | ||
cd zenoh-c && mkdir -p build && cd build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local | ||
cmake --build . --target install --config Release | ||
- name: Fetch and link up-core-api | ||
shell: bash | ||
run: | | ||
git clone -b uprotocol-core-api-1.5.6 https://github.com/eclipse-uprotocol/up-core-api.git | ||
git submodule update --init --recursive | ||
- name: Build && install up-cpp | ||
shell: bash | ||
run: | | ||
mkdir -p build && cd build | ||
conan install .. -o build_testing=True | ||
cmake -S .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=~/local | ||
cmake --build . --target install -- -j | ||
- name: Run the test | ||
shell: bash | ||
run: | | ||
cd build | ||
ctest | ||
# NOTE: In GitHub repository settings, the "Require status checks to pass | ||
# before merging" branch protection rule ensures that commits are only merged | ||
# from branches where specific status checks have passed. These checks are | ||
# specified manually as a list of workflow job names. Thus we use this extra | ||
# job to signal whether all CI checks have passed. | ||
ci: | ||
name: CI status checks | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: always() | ||
steps: | ||
- name: Check whether all jobs pass | ||
run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")' |