From 0e2b409647d1777ab8196ae12a84d0f6ce287624 Mon Sep 17 00:00:00 2001 From: Jan David Date: Wed, 28 Jun 2023 09:30:24 +0200 Subject: [PATCH] Switch to Flowcrafter-managed workflows FlowCrafter[^1] is a command-line tool that makes it easy to create and update GitHub Actions workflows from a shared repository. It has been set up to pull from my personal collection, which is very similar to what was already configured in this repository. The most meaningful change is that Rust builds now run inside a pre-built container. --- .github/flowcrafter.yml | 5 +++++ .github/workflows/release.yml | 12 +++++++----- .github/workflows/rust.yml | 12 ++++++------ .github/workflows/yaml.yml | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 .github/flowcrafter.yml diff --git a/.github/flowcrafter.yml b/.github/flowcrafter.yml new file mode 100644 index 0000000..dc4dea3 --- /dev/null +++ b/.github/flowcrafter.yml @@ -0,0 +1,5 @@ +library: + github: + instance: https://api.github.com/ + owner: jdno + repository: workflows diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4b241d..bb2f5f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,12 +10,14 @@ jobs: name: Publish crate runs-on: ubuntu-latest + container: + image: ghcr.io/jdno/rust:main + steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 - - uses: actions-rs/cargo@v1 - with: - command: publish - args: -v --all-features + - name: Publish crate + run: cargo publish -v --all-features env: CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 925edfe..5afb5cd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -44,6 +44,9 @@ jobs: needs: detect-changes if: needs.detect-changes.outputs.any_changed == 'true' + container: + image: ghcr.io/jdno/rust:main + steps: - name: Checkout code uses: actions/checkout@v3 @@ -51,9 +54,6 @@ jobs: - name: Cache build artifacts uses: swatinem/rust-cache@v2.5.0 - - name: Set up Rust - uses: dtolnay/rust-toolchain@stable - - name: Run Clippy run: cargo clippy --all-targets --all-features -- -D warnings @@ -64,13 +64,13 @@ jobs: needs: detect-changes if: needs.detect-changes.outputs.any_changed == 'true' + container: + image: ghcr.io/jdno/rust:main + steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up Rust - uses: dtolnay/rust-toolchain@stable - - name: Run Rustfmt run: cargo fmt --all -- --check diff --git a/.github/workflows/yaml.yml b/.github/workflows/yaml.yml index 43a459c..ad8f8ba 100644 --- a/.github/workflows/yaml.yml +++ b/.github/workflows/yaml.yml @@ -24,8 +24,8 @@ jobs: uses: tj-actions/changed-files@v37 with: files: | - **/*.yml **/*.yaml + **/*.yml - name: Print changed files run: |