From 39ed70896a85fca3ad37afc21a024aaa23c643ee Mon Sep 17 00:00:00 2001 From: Leon Yee <43097991+unkn-wn@users.noreply.github.com> Date: Wed, 14 Jun 2023 11:46:08 -0700 Subject: [PATCH] [rust] added rust.yml for /rust directory (#193) --- .github/workflows/rust.yml | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 00000000..113c3e05 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,67 @@ +name: Rust + +on: + push: + branches: + - main + pull_request: + paths: + - rust/** + - .github/workflows/rust.yml + +env: + # This env var is used by Swatinem/rust-cache@v2 for the cache + # key, so we set it to make sure it is always consistent. + CARGO_TERM_COLOR: always + # Disable full debug symbol generation to speed up CI build and keep memory down + # "1" means line tables only, which is useful for panic tracebacks. + RUSTFLAGS: "-C debuginfo=1" + RUST_BACKTRACE: "1" + +jobs: + linux: + timeout-minutes: 30 + runs-on: ubuntu-22.04 + defaults: + run: + shell: bash + working-directory: rust + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + lfs: true + - uses: Swatinem/rust-cache@v2 + with: + workspaces: rust + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y protobuf-compiler libssl-dev + - name: Build + run: cargo build --all-features + - name: Run tests + run: cargo test --all-features + macos: + runs-on: macos-12 + timeout-minutes: 30 + defaults: + run: + shell: bash + working-directory: rust + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + lfs: true + - name: CPU features + run: sysctl -a | grep cpu + - uses: Swatinem/rust-cache@v2 + with: + workspaces: rust + - name: Install dependencies + run: brew install protobuf + - name: Build + run: cargo build --all-features + - name: Run tests + run: cargo test --all-features