Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: clippy #659

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/actions/rust-info/action.yml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Clippy check

on:
push:
branches: ["**"]

env:
RUSTFLAGS: "-Dwarnings"

permissions: {}

jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
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
4 changes: 3 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down
106 changes: 106 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = "1.36.0"

[lints.clippy]
pedantic = "warn"
Loading