Skip to content
Merged
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
46 changes: 40 additions & 6 deletions .github/workflows/check_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ on:
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
Expand All @@ -23,11 +41,27 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- name: install rustup
- 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: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add x86_64-unknown-linux-gnu
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

- name: check diff
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 }}
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
250 changes: 0 additions & 250 deletions ci/check_diff.sh

This file was deleted.

Loading