Skip to content

Commit 476c42e

Browse files
committed
ci: saikyou
1 parent 88f4f23 commit 476c42e

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

.github/actions/rust-info/action.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
2+
3+
name: rust info
4+
description: get rust info
5+
6+
outputs:
7+
package-names:
8+
description: package name "foo"
9+
value: ${{steps.cargo.outputs.package-names}}
10+
host:
11+
description: host "x86_64-unknown-linux-gnu"
12+
value: ${{steps.rustc.outputs.host}}
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- id: cargo
18+
run: |
19+
echo "package-names=$(cargo metadata --no-deps | jq --compact-output '.packages | map(.name)')" >> $GITHUB_OUTPUT
20+
shell: bash
21+
- id: rustc
22+
run: |
23+
echo "host=$(rustc -vV | awk '/host/ { print $2 }')" >> $GITHUB_OUTPUT
24+
shell: bash

.github/workflows/clippy.yml

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
with:
1919
toolchain: stable
2020
components: clippy
21+
- id: rustc
22+
uses: ./.github/actions/rust-info
2123
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
24+
with:
25+
key: ${{ steps.rustc.outputs.host }}
2226
- name: Run Clippy
2327
run: cargo clippy --all-targets --all-features

.github/workflows/docker-publish.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ jobs:
6363
with:
6464
toolchain: stable
6565
target: ${{ matrix.target }}
66+
- id: rustc
67+
uses: ./.github/actions/rust-info
6668
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
6769
with:
6870
key: ${{ matrix.target }}
@@ -96,7 +98,7 @@ jobs:
9698
needs: build
9799
permissions:
98100
packages: write
99-
runs-on: 'ubuntu-latest'
101+
runs-on: "ubuntu-latest"
100102
outputs:
101103
image_tags: ${{ steps.meta.outputs.tags }}
102104
env:

0 commit comments

Comments
 (0)