Skip to content

Commit

Permalink
introduce Rust CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sksat committed Dec 21, 2023
1 parent 8da067d commit ca6cd51
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Rust

on:
push:
branches: [ main ]
pull_request:

permissions:
id-token: write
contents: read
checks: write
pull-requests: write

env:
CARGO_INCREMENTAL: 0

jobs:
rust:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4.1.0
with:
submodules: recursive

- name: Get Rust toolchain
id: toolchain
run: |
awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ steps.toolchain.outputs.toolchain }}
components: clippy, rustfmt

- name: cache dependencies
uses: Swatinem/rust-cache@v2.7.0

- name: reviewdog / clippy
uses: sksat/action-clippy@v0.4.0
with:
reporter: github-pr-review

- name: format
run: |
cargo fmt --all -- --check
- name: unit test
run: |
cargo test

0 comments on commit ca6cd51

Please sign in to comment.