summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2022-05-09 16:41:08 -0400
committerGitHub <noreply@github.com>2022-05-09 16:41:08 -0400
commit891c7dffa7816c711d2090c6ea1979afc254cee4 (patch)
tree3d2f5e0a43f464336995aa932ea7a595ae8ea12d /.github
parent73d3c16a9d7b0b313d3af8f24730d891cd3ca33e (diff)
parent60404565e54181bcbb8ef026d1b1a449bfa6afba (diff)
downloadostree-891c7dffa7816c711d2090c6ea1979afc254cee4.tar.gz
Merge pull request #2575 from cgwalters/merge-ostree-rs
Merge ostree-rs into this repository
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/rust.yml55
1 files changed, 46 insertions, 9 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index ef6e38a7..d047c8c7 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -1,31 +1,68 @@
----
name: Rust
+permissions:
+ actions: read
+
on:
push:
- branches: [main]
+ branches: [ main ]
pull_request:
- branches: [main]
-
-permissions:
- contents: read
+ branches: [ main ]
env:
CARGO_TERM_COLOR: always
- ACTIONS_LINTS_TOOLCHAIN: 1.53.0
+ CARGO_PROJECT_FEATURES: "v2021_3"
+ # Minimum supported Rust version (MSRV)
+ ACTION_MSRV_TOOLCHAIN: 1.54.0
+ # Pinned toolchain for linting
+ ACTION_LINTS_TOOLCHAIN: 1.56.0
jobs:
+ 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
+ - name: Build
+ run: cargo build --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
+ - name: Run tests
+ run: cargo test --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
+ 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
+ - 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
+ - name: cargo build
+ run: cargo build --features=${{ env['CARGO_PROJECT_FEATURES'] }}
linting:
name: "Lints, pinned toolchain"
runs-on: ubuntu-latest
+ container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
steps:
- name: Checkout repository
uses: actions/checkout@v2
+ - name: Remove system Rust toolchain
+ run: dnf remove -y rust cargo
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
- toolchain: ${{ env['ACTIONS_LINTS_TOOLCHAIN'] }}
+ toolchain: ${{ env['ACTION_LINTS_TOOLCHAIN'] }}
default: true
components: rustfmt, clippy
- name: cargo fmt (check)
- run: cargo fmt -- --check -l
+ run: cargo fmt -p ostree -- --check -l
+ - name: cargo clippy (warnings)
+ run: cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} -- -D warnings