diff --git a/.github/actions/rust-info/action.yml b/.github/actions/rust-info/action.yml new file mode 100644 index 000000000..342683cdd --- /dev/null +++ b/.github/actions/rust-info/action.yml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-action.json + +name: rust info +description: get rust info + +outputs: + package-names: + description: package name "foo" + value: ${{steps.cargo.outputs.package-names}} + host: + description: host "x86_64-unknown-linux-gnu" + value: ${{steps.rustc.outputs.host}} + +runs: + using: composite + steps: + - id: cargo + run: | + echo "package-names=$(cargo metadata --no-deps | jq --compact-output '.packages | map(.name)')" >> $GITHUB_OUTPUT + shell: bash + - id: rustc + run: | + echo "host=$(rustc -vV | awk '/host/ { print $2 }')" >> $GITHUB_OUTPUT + shell: bash diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index f46c983c9..ace098800 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -18,6 +18,10 @@ jobs: with: toolchain: stable components: clippy + - id: rustc + uses: ./.github/actions/rust-info - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + with: + key: ${{ steps.rustc.outputs.host }} - name: Run Clippy run: cargo clippy --all-targets --all-features diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5fa3d1024..4a66d5b77 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -63,6 +63,8 @@ jobs: with: toolchain: stable target: ${{ matrix.target }} + - id: rustc + uses: ./.github/actions/rust-info - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 with: key: ${{ matrix.target }} @@ -96,7 +98,7 @@ jobs: needs: build permissions: packages: write - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" outputs: image_tags: ${{ steps.meta.outputs.tags }} env: