Update dependencies to resolve security audit issues (#178) #449
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: Rust CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
static_code_analysis: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install protobuf-compiler | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Install Rust toolchain | |
uses: ./.github/actions/install-rust-toolchain | |
with: | |
components: clippy rustfmt | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Cargo check workspace | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
# Note: cargo check should use the --locked option | |
# Excluding it because of this known issue: https://github.com/mozilla/uniffi-rs/issues/1032 | |
args: --workspace | |
- name: Cargo clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all-targets --all-features --workspace --no-deps -- -D warnings | |
- name: Cargo format check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Run doctest only | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace --doc | |
- name: Run cargo doc | |
# This step is required to detect possible errors in docs that are not doctests. | |
uses: actions-rs/cargo@v1 | |
with: | |
command: doc | |
args: --workspace --no-deps # Warnings are treated as errors due to our .cargo/config file. | |
build_and_test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install protobuf-compiler | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Install Rust toolchain | |
uses: ./.github/actions/install-rust-toolchain | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
- name: Test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test |