-
Notifications
You must be signed in to change notification settings - Fork 996
67 lines (60 loc) · 2.04 KB
/
check_diff.yml
File metadata and controls
67 lines (60 loc) · 2.04 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
name: Diff Check
on:
workflow_dispatch:
inputs:
clone_url:
description: 'Git url of a rustfmt fork to compare against the latest rustfmt'
required: true
branch_name:
description: 'Name of the feature branch on the forked repo'
required: true
language_edition:
description: 'Rust language `edition` used to parse code'
required: true
default: 2015
type: choice
options:
- 2015
- 2018
- 2021
- 2024
style_edition:
description: 'rustfmt `style_edition` used when formatting code.'
required: true
default: 2021
type: choice
options:
- 2021 # 2015, 2018, and 2021 are all formatted the same since `style_edition` was added between 2021 and 2024
- 2024
commit_hash:
description: 'Optional commit hash from the feature branch'
required: false
rustfmt_configs:
description: 'Optional comma separated list of rustfmt config options to pass when running the feature branch'
required: false
jobs:
diff_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Build check_diff binary
working-directory: ./check_diff
run: cargo build --release
- name: Run Diff Check
working-directory: ./check_diff
env:
CHECK_DIFF_LOG: info
shell: bash
run: |
OPTIONS=""
if [[ -n "${{ github.event.inputs.commit_hash }}" ]]; then
OPTIONS+="--commit-hash ${{ github.event.inputs.commit_hash }} "
fi
if [[ -n "${{ github.event.inputs.rustfmt_configs }}" ]]; then
OPTIONS+="--rustfmt-config ${{ github.event.inputs.rustfmt_configs }} "
fi
target/release/check_diff ${{ github.event.inputs.clone_url }} ${{ github.event.inputs.branch_name }} \
--edition ${{ github.event.inputs.language_edition }} \
--style-edition ${{ github.event.inputs.style_edition }} \
$OPTIONS