CI #1103
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
name: CI | |
on: | |
push: | |
branches: ["**"] | |
pull_request: | |
branches: ["**"] | |
schedule: | |
- cron: "0 6 * * 1-5" | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
components: rustfmt, clippy | |
- name: Clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all --examples -- -D warnings | |
- name: Run rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: -- --check | |
- name: build and install | |
shell: bash | |
run: | | |
mkdir -p build && cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local | |
cmake --build . --target install --config Release | |
- name: make examples | |
shell: bash | |
run: | | |
cd build | |
cmake --build . --target examples | |
- name: make examples with zenoh-c as subbroject | |
shell: bash | |
run: | | |
mkdir -p build_examples_subproj && cd build_examples_subproj | |
cmake ../examples -DCMAKE_BUILD_TYPE=Debug | |
cmake --build . --config Debug | |
- name: make examples with zenoh-c as installed package | |
shell: bash | |
run: | | |
mkdir -p build_examples_findproj && cd build_examples_findproj | |
cmake ../examples -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local -DZENOHC_SOURCE=PACKAGE | |
cmake --build . --config Release | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --verbose --release | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
# Artifact name | |
name: zenoh-c-${{ matrix.os }} | |
# Directory containing files to upload | |
path: | | |
target/release | |
!target/release/build | |
!target/release/deps | |
!target/release/.* | |
!target/release/*.d |