Skip to content

Commit 09e99b8

Browse files
committed
call the rust check_diff binary from .github/workflows/check_diff.yml
Now we're calling our rust binary instead of our old shell script.
1 parent 9062982 commit 09e99b8

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/check_diff.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,25 @@ jobs:
2323
- name: checkout
2424
uses: actions/checkout@v4
2525

26-
- name: install rustup
26+
- name: Build check_diff binary
27+
working-directory: ./check_diff
28+
run: cargo build -r
29+
30+
- name: Run Diff Check
31+
working-directory: ./check_diff
32+
env:
33+
CHECK_DIFF_LOG: info
34+
shell: bash
2735
run: |
28-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
29-
sh rustup-init.sh -y --default-toolchain none
30-
rustup target add x86_64-unknown-linux-gnu
36+
OPTIONS=""
37+
38+
if [[ -n "${{ github.event.inputs.commit_hash }}" ]]; then
39+
OPTIONS="--commit-hash ${{ github.event.inputs.commit_hash }} "
40+
fi
41+
42+
if [[ -n "${{ github.event.inputs.rustfmt_configs }}" ]]; then
43+
OPTIONS="--rustfmt-config ${{ github.event.inputs.rustfmt_configs }} "
44+
fi
3145
32-
- name: check diff
33-
run: bash ${GITHUB_WORKSPACE}/ci/check_diff.sh ${{ github.event.inputs.clone_url }} ${{ github.event.inputs.branch_name }} ${{ github.event.inputs.commit_hash || github.event.inputs.branch_name }} ${{ github.event.inputs.rustfmt_configs }}
46+
target/release/check_diff ${{ github.event.inputs.clone_url }} ${{ github.event.inputs.branch_name }} \
47+
$OPTIONS

0 commit comments

Comments
 (0)