Skip to content
Draft
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
22 changes: 3 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
submodules: recursive
token: ${{ secrets.JENKINS_GITHUB_PAT }}

- name: 'Install Nix'
uses: cachix/install-nix-action@v25
Expand All @@ -40,28 +39,15 @@ jobs:
uses: cachix/cachix-action@v17
with:
name: k-framework
authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}'

- name: Format
run: nix develop .#style --command bash -c './scripts/fourmolu.sh'

- name: Update branch
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
- name: Check formatting
run: |
if git status -s -b | grep -q '^##.*(no branch)$'; then
echo 2>&1 "Error: Git is in detached HEAD state"
exit 1
fi

if [ -n "$(git status --porcelain '*.hs')" ]; then
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git add '*.hs'
git commit -m "Format with fourmolu"
git show --stat
git push
echo "Reformatted code pushed, aborting this workflow" | tee -a $GITHUB_STEP_SUMMARY
echo "Code is not formatted. Run scripts/fourmolu.sh and commit the result." | tee -a $GITHUB_STEP_SUMMARY
git diff --stat
exit 1
fi
# could run hlint here, but then no more jobs would run if the code is not accepted
Expand Down Expand Up @@ -110,7 +96,6 @@ jobs:
uses: cachix/cachix-action@v17
with:
name: k-framework
authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}'

- name: Build
run: GC_DONT_GC=1 nix build .#kore-exec .#kore-rpc-booster
Expand Down Expand Up @@ -258,7 +243,6 @@ jobs:
uses: cachix/cachix-action@v17
with:
name: k-framework
authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}'

- name: Format
run: nix develop .#style --command bash -c './scripts/hlint.sh'