-
-
Notifications
You must be signed in to change notification settings - Fork 110
90 lines (79 loc) · 2.54 KB
/
Copy pathformat.yml
File metadata and controls
90 lines (79 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Formatting and Linting
on:
pull_request:
paths:
- 'crates/**'
- 'Cargo.toml'
- 'rustfmt.toml'
- '.github/workflows/format.yml'
push:
branches: [ 'main' ]
tags-ignore: [ '*' ]
paths:
- 'crates/**'
- 'Cargo.toml'
- 'rustfmt.toml'
- '.github/workflows/format.yml'
permissions:
contents: read
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Run fmt check
id: cargoFmt
shell: bash
run: cargo +nightly fmt --all -- --check
- name: Save fmt check result
if: always() && github.event_name == 'pull_request'
run: |
mkdir -p ./pr-check-results
echo "${{ steps.cargoFmt.outcome }}" > ./pr-check-results/fmt-outcome.txt
echo "${{ github.event.pull_request.number }}" > ./pr-check-results/pr-number.txt
echo "${{ github.event.pull_request.head.sha }}" > ./pr-check-results/pr-head-sha.txt
- name: Upload fmt check result
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: fmt-check-result
path: ./pr-check-results/
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "cargo-lambda-clippy-v1"
cache-on-failure: false
- name: Run clippy check
id: cargoClippy
shell: bash
run: make clippy
- name: Save clippy check result
if: always() && github.event_name == 'pull_request'
run: |
mkdir -p ./pr-check-results
echo "${{ steps.cargoClippy.outcome }}" > ./pr-check-results/clippy-outcome.txt
echo "${{ github.event.pull_request.number }}" > ./pr-check-results/pr-number.txt
echo "${{ github.event.pull_request.head.sha }}" > ./pr-check-results/pr-head-sha.txt
- name: Upload clippy check result
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: clippy-check-result
path: ./pr-check-results/
licenses:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check bans licenses sources