Fix CI and add codespell checks #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Check Rust Format | |
on: | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
name: Check Style | |
runs-on: ubuntu-22.04 | |
container: fedora:latest | |
steps: | |
- name: Install Dependencies | |
run: | | |
dnf -y install git rustfmt | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup | |
if: ${{ github.event.pull_request.base.sha }} | |
run: | | |
git config --global --add safe.directory /__w/kryoptic/kryoptic | |
git fetch origin main ${{ github.event.pull_request.base.sha }} | |
- name: Run rustfmt | |
run: | | |
rustfmt src/*.rs src/*/*.rs | |
@lines=`git diff -U0 --no-color |wc -l`; \ | |
if [ "$$lines" != "0" ]; then \ | |
echo "Rustfmt issues detected"; \ | |
exit 1; \ | |
else \ | |
echo "Rustfmt is happy"; \ | |
fi | |
- name: Codespell | |
run: codespell --ignore-words-list="sorce,clen,adin,ciph,tolen,ot,siz" src/ |