-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (45 loc) · 1.3 KB
/
check-style.yml
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
---
name: Check Style
on:
pull_request:
branches: ["main"]
jobs:
build:
name: Check Style
runs-on: ubuntu-22.04
container: fedora:latest
steps:
- name: Get Date for DNF cache entry
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
shell: bash
- name: Store DNF cache
uses: actions/cache@v4
with:
path: |
/var/cache/dnf
key: ${{ runner.os }}-dnf-${{ steps.get-date.outputs.date }}
- name: Install Dependencies
run: |
dnf -y install git rustfmt codespell make
- name: Checkout Repository
uses: actions/checkout@v4
- 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: |
make fix-format
LINES=`git diff -U0 --no-color |wc -l`; \
if [ "$LINES" != "0" ]; then \
echo "Rustfmt issues detected"; \
git diff -U0 --no-color
exit 1; \
else \
echo "Rustfmt is happy"; \
fi
- name: Codespell
run: make check-spell