Skip to content

CI

CI #2319

Workflow file for this run

#
# Copyright (c) 2024 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <zenoh@zettascale.tech>
#
name: CI
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
schedule:
- cron: "0 6 * * 1-5"
jobs:
check_rust:
name: Check zenoh-ts using Rust 1.75
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.75.0
- uses: Swatinem/rust-cache@v2
with:
cache-bin: false
- name: Check zenoh-ts with rust 1.75.0
run: |
cargo +1.75.0 check --release --bins --lib
rust:
name: Lints and doc tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
cache-bin: false
- name: Install rustfmt and clippy if not installed
run: |
rustup component add rustfmt clippy || true
rustup component list --installed
- name: Code format check
run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
- name: Clippy
run: cargo clippy --all -- -D warnings
- name: Run rust tests
run: cargo test
typescript:
name: Run typescript tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-bin: false
- name: Build typescript plugin
run: cargo build --release --all-targets
- name: Install zenohd for testing
run: |
cargo install cargo-run-bin --locked
cargo bin --install zenohd
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: latest
- name: Verify build of zenoh-ts, tests and examples
uses: borales/actions-yarn@v4
with:
cmd: build ALL
dir: "zenoh-ts"
- name: Run linter
uses: borales/actions-yarn@v4
with:
cmd: lint
dir: "zenoh-ts"
- name: Run tests
uses: borales/actions-yarn@v4
with:
cmd: start DAEMON test ALL
dir: "zenoh-ts"
markdown_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v18
with:
config: '.markdownlint.yaml'
globs: '**/README.md'
# 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: [check_rust, rust, typescript, markdown_lint]
if: always()
steps:
- name: Check whether all jobs pass
run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")'