Skip to content

Commit 4c039d4

Browse files
authored
Merge pull request #40 from cgwalters/revdep-testing
ci: Revamp
2 parents 645c6c3 + 41c9cfb commit 4c039d4

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

.github/workflows/ci.yaml

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@ on:
1212
env:
1313
# Pinned toolchain for linting
1414
ACTION_LINTS_TOOLCHAIN: 1.58.1
15-
# Minimum supported Rust version (MSRV)
16-
ACTION_MSRV_TOOLCHAIN: 1.58.1
17-
CARGO_INCREMENTAL: 0
1815
CARGO_NET_RETRY: 10
1916
CARGO_TERM_COLOR: always
2017
CI: 1
2118
RUSTUP_MAX_RETRIES: 10
2219
RUST_BACKTRACE: short
2320

2421
jobs:
25-
rust:
26-
name: Rust
22+
build-test:
23+
name: Build+Test
2724
runs-on: ubuntu-latest
2825
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
2926
strategy:
@@ -32,51 +29,52 @@ jobs:
3229
os: [ubuntu-latest]
3330
steps:
3431
- name: Checkout repository
35-
uses: actions/checkout@v2
32+
uses: actions/checkout@v3
3633
with:
3734
ref: ${{ github.event.pull_request.head.sha }}
3835
fetch-depth: 20
39-
- name: Install Rust toolchain
40-
uses: actions-rs/toolchain@v1
41-
with:
42-
toolchain: stable
43-
profile: minimal
44-
override: true
36+
- uses: dtolnay/rust-toolchain@stable
4537
- name: Cache Dependencies
46-
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
38+
uses: Swatinem/rust-cache@v2
4739
- name: Compile (no features)
4840
run: cargo test --no-run
4941
- name: Compile (all features)
5042
run: cargo test --no-run --all-features
5143
- name: Test
5244
run: cargo test --all-features -- --nocapture --quiet
53-
# TODO: Re-enable this when git master there lands https://github.com/ostreedev/ostree-rs-ext/pull/123
54-
# - name: Checkout ostree-rs-ext
55-
# uses: actions/checkout@v2
56-
# with:
57-
# repository: ostreedev/ostree-rs-ext
58-
# path: ostree-rs-ext
59-
# fetch-depth: 20
60-
# - name: Test ostree-rs-ext
61-
# run: ./ci/test-ostree-rs-ext.sh
45+
- name: Checkout ostree-rs-ext
46+
uses: actions/checkout@v3
47+
with:
48+
repository: ostreedev/ostree-rs-ext
49+
path: ostree-rs-ext
50+
fetch-depth: 20
51+
- name: Test ostree-rs-ext
52+
run: ./ci/test-ostree-rs-ext.sh
6253
build-minimum-toolchain:
6354
name: "Build, minimum supported toolchain (MSRV)"
6455
runs-on: ubuntu-latest
6556
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
6657
steps:
6758
- name: Checkout repository
68-
uses: actions/checkout@v2
59+
uses: actions/checkout@v3
60+
- name: Detect crate MSRV
61+
shell: bash
62+
run: |
63+
msrv=$(cargo metadata --format-version 1 --no-deps | \
64+
jq -r '.packages | .[0].rust_version')
65+
echo "Crate MSRV: $msrv"
66+
echo "ACTION_MSRV_TOOLCHAIN=$msrv" >> $GITHUB_ENV
6967
- name: Remove system Rust toolchain
7068
run: dnf remove -y rust cargo
71-
- name: Install toolchain
72-
uses: actions-rs/toolchain@v1
69+
- uses: dtolnay/rust-toolchain@master
7370
with:
7471
toolchain: ${{ env['ACTION_MSRV_TOOLCHAIN'] }}
75-
default: true
7672
- name: Cache Dependencies
77-
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
78-
- name: cargo build
79-
run: cargo build
73+
uses: Swatinem/rust-cache@v2
74+
with:
75+
key: msrv
76+
- name: cargo check
77+
run: cargo check
8078
linting:
8179
name: "Lints, pinned toolchain"
8280
runs-on: ubuntu-latest
@@ -86,11 +84,9 @@ jobs:
8684
uses: actions/checkout@v2
8785
- name: Remove system Rust toolchain
8886
run: dnf remove -y rust cargo
89-
- name: Install toolchain
90-
uses: actions-rs/toolchain@v1
87+
- uses: dtolnay/rust-toolchain@master
9188
with:
9289
toolchain: ${{ env['ACTION_LINTS_TOOLCHAIN'] }}
93-
default: true
9490
components: rustfmt, clippy
9591
- name: cargo fmt (check)
9692
run: cargo fmt -- --check -l

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ name = "containers-image-proxy"
66
readme = "README.md"
77
repository = "https://github.com/containers/containers-image-proxy-rs"
88
version = "0.5.1"
9+
rust-version = "1.58.0"
910

1011
[dependencies]
1112
anyhow = "1.0"

src/imageproxy.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,10 @@ impl ImageProxy {
491491

492492
///Returns data that can be used to find the "diffid" corresponding to a particular layer.
493493
#[instrument]
494-
pub async fn get_layer_info(&self, img: &OpenedImage) -> Result<Option<Vec<ConvertedLayerInfo>>> {
494+
pub async fn get_layer_info(
495+
&self,
496+
img: &OpenedImage,
497+
) -> Result<Option<Vec<ConvertedLayerInfo>>> {
495498
tracing::debug!("Getting layer info");
496499
if !LAYER_INFO_PROTO_VERSION.matches(&self.protover) {
497500
return Ok(None);

0 commit comments

Comments
 (0)