lite-rpc/.github/workflows/build_test.yml

52 lines
1.3 KiB
YAML
Raw Normal View History

2023-03-03 13:24:09 -08:00
name: Cargo Build & Test
2023-03-03 13:24:09 -08:00
on:
push:
branches:
- main
2023-03-03 13:24:09 -08:00
pull_request:
2023-09-19 02:03:12 -07:00
env:
2023-03-03 13:24:09 -08:00
CARGO_TERM_COLOR: always
2023-09-19 02:03:12 -07:00
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: "1G"
2023-03-03 13:24:09 -08:00
jobs:
build_and_test:
2023-09-19 02:03:12 -07:00
name: lite-rpc full build
runs-on: ubuntu-22.04
2023-03-03 13:24:09 -08:00
steps:
2023-09-19 02:03:12 -07:00
- name: Install Linux Packages
2023-03-17 06:44:13 -07:00
run: |
2023-03-18 03:04:55 -07:00
sudo apt-get update -y
sudo apt-get install libssl-dev openssl -y
2023-03-03 13:24:09 -08:00
2023-09-19 02:03:12 -07:00
- uses: actions/checkout@v4
# The toolchain action should definitely be run before the cache action
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: true
# avoid the default "-D warnings" which thrashes cache
rustflags: ""
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
2023-07-25 05:15:43 -07:00
2023-09-19 02:03:12 -07:00
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo
# https://blog.arriven.wtf/posts/rust-ci-cache/
- uses: Swatinem/rust-cache@v2
with:
# will be covered by sscache
cache-targets: false
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Early Build
run: |
cargo build --locked --workspace --all-targets
2023-11-27 23:31:18 -08:00
2023-07-25 05:15:43 -07:00
- name: Run Tests
2023-08-08 02:50:02 -07:00
run: RUST_LOG=info cargo test