2021-03-17 17:23:47 +00:00
name : Rust
2021-07-28 18:32:04 -04:00
2022-05-09 14:52:46 -04:00
permissions :
actions : read
2021-03-17 17:23:47 +00:00
on :
push :
2022-05-09 14:52:46 -04:00
branches : [ main ]
2021-03-17 17:23:47 +00:00
pull_request :
2022-05-09 14:52:46 -04:00
branches : [ main ]
2021-07-28 18:32:04 -04:00
2021-03-17 17:23:47 +00:00
env :
CARGO_TERM_COLOR : always
2023-08-31 14:08:15 -04:00
CARGO_PROJECT_FEATURES : "v2022_6"
2022-06-08 09:53:33 -04:00
# TODO: Automatically query this from the C side
2022-10-27 12:58:43 +00:00
LATEST_LIBOSTREE : "v2022_6"
2021-03-17 17:23:47 +00:00
jobs :
2022-05-09 14:52:46 -04:00
build :
runs-on : ubuntu-latest
container : quay.io/coreos-assembler/fcos-buildroot:testing-devel
steps :
- uses : actions/checkout@v2
- name : Cache Dependencies
uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
2023-08-31 16:33:07 -04:00
- name : cargo fmt (check)
run : cargo fmt -p ostree -- --check -l
2022-05-09 14:52:46 -04:00
- name : Build
run : cargo build --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
- name : Run tests
run : cargo test --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
2023-08-31 16:33:07 -04:00
- name : cargo clippy (non-gating)
run : cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }}
2022-05-09 14:52:46 -04:00
build-minimum-toolchain :
name : "Build, minimum supported toolchain (MSRV)"
runs-on : ubuntu-latest
container : quay.io/coreos-assembler/fcos-buildroot:testing-devel
steps :
- name : Checkout repository
uses : actions/checkout@v2
2022-11-18 09:13:12 +00:00
- name : Detect crate MSRV
shell : bash
run : |
msrv=$(cargo metadata --format-version 1 --no-deps | \
jq -r '.packages | .[0].rust_version')
echo "Crate MSRV: $msrv"
echo "ACTION_MSRV_TOOLCHAIN=$msrv" >> $GITHUB_ENV
2022-05-09 14:52:46 -04:00
- name : Remove system Rust toolchain
run : dnf remove -y rust cargo
- name : Install toolchain
uses : actions-rs/toolchain@v1
with :
toolchain : ${{ env['ACTION_MSRV_TOOLCHAIN'] }}
default : true
- name : Cache Dependencies
uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
2022-06-23 14:44:33 -04:00
- name : cargo check
run : cargo check --features=${{ env['CARGO_PROJECT_FEATURES'] }}
2022-06-23 14:43:55 -04:00
build-no-features :
runs-on : ubuntu-latest
container : quay.io/coreos-assembler/fcos-buildroot:testing-devel
steps :
- uses : actions/checkout@v2
- name : Cache Dependencies
uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
- name : Build
run : cargo test --no-run
- name : Run tests
run : cargo test --verbose
2022-06-08 09:53:33 -04:00
build-git-libostree :
runs-on : ubuntu-latest
container : quay.io/coreos-assembler/fcos-buildroot:testing-devel
steps :
- uses : actions/checkout@v2
with :
fetch-depth : 0
submodules : true
- name : Cache Dependencies
uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
- name : Build libostree
run : ./ci/build.sh
- name : Install libostree
run : make install
- name : Rust build
run : cargo test --no-run --verbose --features=${{ env['LATEST_LIBOSTREE'] }}
- name : Run tests
run : cargo test --verbose --features=${{ env['LATEST_LIBOSTREE'] }}
2022-05-10 17:13:44 -04:00
cargo-deny :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v2
- uses : EmbarkStudios/cargo-deny-action@v1
with :
log-level : warn
command : check bans sources licenses