chore(deps): bump flate2 from 1.0.35 to 1.1.0 #199
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
name: Rust CI | |
on: | |
pull_request: | |
types: [closed] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check_changes: | |
runs-on: ubuntu-latest | |
# exec only when PR is merged | |
if: github.event.pull_request.merged == true | |
outputs: | |
rust_changed: ${{ steps.check_rust_changes.outputs.rust_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check for Rust file changes | |
id: check_rust_changes | |
run: | | |
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} > changes.txt | |
if grep -qE '\.rs$|Cargo\.toml' changes.txt; then | |
echo "rust_changed=true" >> $GITHUB_OUTPUT | |
else | |
echo "rust_changed=false" >> $GITHUB_OUTPUT | |
fi | |
rust_ci: | |
needs: check_changes | |
if: needs.check_changes.outputs.rust_changed == 'true' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.84.0 | |
profile: minimal | |
override: true | |
target: ${{ matrix.target }} | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Cache build output | |
uses: actions/cache@v3 | |
with: | |
path: target | |
key: ${{ runner.os }}-${{ matrix.target }}-target-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.target }}-target- | |
- name: Install cross | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: cross | |
- name: Build with cross | |
run: cross build --target ${{ matrix.target }} --release | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: ${{ fromJSON('{"x86_64-unknown-linux-gnu":"linux/amd64","x86_64-unknown-linux-musl":"linux/amd64"}')[matrix.target] }} | |
- name: Docker Buildx cache | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: ${{ fromJSON('{"x86_64-unknown-linux-gnu":"linux/amd64","x86_64-unknown-linux-musl":"linux/amd64"}')[matrix.target] }} | |
tags: ghcr.io/${{ github.repository }}:latest-${{ matrix.target }} | |
file: docker/${{ matrix.target }}/Dockerfile | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
no_changes: | |
needs: check_changes | |
if: needs.check_changes.outputs.rust_changed == 'false' | |
runs-on: ubuntu-latest | |
steps: | |
- name: No Rust changes | |
run: echo "No changes to Rust files or Cargo.toml, skipping CI." |