Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 28 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ on:
env:
# Pinned toolchain for linting
ACTION_LINTS_TOOLCHAIN: 1.58.1
# Minimum supported Rust version (MSRV)
ACTION_MSRV_TOOLCHAIN: 1.58.1
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
CI: 1
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short

jobs:
rust:
name: Rust
build-test:
name: Build+Test
runs-on: ubuntu-latest
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
strategy:
Expand All @@ -32,51 +29,52 @@ jobs:
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 20
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: dtolnay/rust-toolchain@stable
- name: Cache Dependencies
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
uses: Swatinem/rust-cache@v2
- name: Compile (no features)
run: cargo test --no-run
- name: Compile (all features)
run: cargo test --no-run --all-features
- name: Test
run: cargo test --all-features -- --nocapture --quiet
# TODO: Re-enable this when git master there lands https://github.com/ostreedev/ostree-rs-ext/pull/123
# - name: Checkout ostree-rs-ext
# uses: actions/checkout@v2
# with:
# repository: ostreedev/ostree-rs-ext
# path: ostree-rs-ext
# fetch-depth: 20
# - name: Test ostree-rs-ext
# run: ./ci/test-ostree-rs-ext.sh
- name: Checkout ostree-rs-ext
uses: actions/checkout@v3
with:
repository: ostreedev/ostree-rs-ext
path: ostree-rs-ext
fetch-depth: 20
- name: Test ostree-rs-ext
run: ./ci/test-ostree-rs-ext.sh
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
uses: actions/checkout@v3
- 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
- name: Remove system Rust toolchain
run: dnf remove -y rust cargo
- name: Install toolchain
uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env['ACTION_MSRV_TOOLCHAIN'] }}
default: true
- name: Cache Dependencies
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
- name: cargo build
run: cargo build
uses: Swatinem/rust-cache@v2
with:
key: msrv
- name: cargo check
run: cargo check
linting:
name: "Lints, pinned toolchain"
runs-on: ubuntu-latest
Expand All @@ -86,11 +84,9 @@ jobs:
uses: actions/checkout@v2
- name: Remove system Rust toolchain
run: dnf remove -y rust cargo
- name: Install toolchain
uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env['ACTION_LINTS_TOOLCHAIN'] }}
default: true
components: rustfmt, clippy
- name: cargo fmt (check)
run: cargo fmt -- --check -l
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "containers-image-proxy"
readme = "README.md"
repository = "https://github.com/containers/containers-image-proxy-rs"
version = "0.5.1"
rust-version = "1.58.0"

[dependencies]
anyhow = "1.0"
Expand Down
5 changes: 4 additions & 1 deletion src/imageproxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,10 @@ impl ImageProxy {

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