Bump the dependencies group across 1 directory with 20 updates #252
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
publish-tag: | |
type: string | |
required: false | |
description: "Publish a tag" | |
name: CI | |
jobs: | |
build_and_test: | |
name: Rust project | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
include: | |
- os: ubuntu-latest | |
bin: docker-repack | |
name: docker-repack-Linux-x86_64.tar.gz | |
- os: macOS-latest | |
bin: docker-repack | |
name: docker-repack-Darwin-x86_64.tar.gz | |
- os: windows-latest | |
bin: docker-repack.exe | |
name: docker-repack-Windows-x86_64.zip | |
env: | |
RUST_BACKTRACE: "1" | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
release_profile: "lto" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.publish-tag || null }} | |
- name: Run sccache-cache | |
uses: mozilla-actions/sccache-action@v0.0.7 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache-on-failure: 'false' | |
- name: Build | |
run: cargo build --all-targets | |
- name: Test | |
run: cargo test | |
- name: Integration test | |
run: cargo run -- "docker://python:3.11-slim" oci://test-image/ --target-size="500MB" --compression-level=1 --platform=linux/arm64 | |
- name: Build release | |
if: startsWith(github.ref, 'refs/tags/') || inputs.publish-tag | |
run: cargo build --profile=${{env.release_profile}} | |
- name: Package | |
if: startsWith(github.ref, 'refs/tags/') || inputs.publish-tag | |
shell: bash | |
run: | | |
strip target/${{env.release_profile}}/${{ matrix.bin }} | |
cd target/${{env.release_profile}} | |
if [[ "${{ matrix.os }}" == "windows-latest" ]] | |
then | |
7z a ../../${{ matrix.name }} ${{ matrix.bin }} | |
else | |
tar czvf ../../${{ matrix.name }} ${{ matrix.bin }} | |
fi | |
cd - | |
- name: Archive binaries | |
uses: actions/upload-artifact@v4 | |
if: startsWith(github.ref, 'refs/tags/') || inputs.publish-tag | |
with: | |
name: build-${{ matrix.name }} | |
path: ${{ matrix.name }} | |
create_release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') || inputs.publish-tag | |
needs: [ build_and_test ] | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.publish-tag || null }} | |
- uses: actions/download-artifact@v4 | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "${{ inputs.publish-tag }}" | |
draft: false | |
files: | | |
**/*.tar.gz | |
**/*.zip | |
checks: | |
name: Checks | |
runs-on: ubuntu-latest | |
env: | |
RUST_BACKTRACE: "1" | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.publish-tag || null }} | |
- name: Run sccache-cache | |
uses: mozilla-actions/sccache-action@v0.0.7 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache-on-failure: 'false' | |
- name: Run cargo fmt | |
if: success() || failure() | |
run: cargo fmt --all -- --check | |
- name: Run cargo check | |
if: success() || failure() | |
run: cargo check | |
- if: success() || failure() | |
run: cargo clippy --all-targets --all-features -- -D warnings |