Skip to content

Dump header hash and slot no for events #15

Dump header hash and slot no for events

Dump header hash and slot no for events #15

name: Check Stylish Haskell
on:
push:
merge_group:
# When pushing branches (and/or updating PRs), we do want to cancel previous
# build runs. We assume they are stale now; and do not want to spend CI time and
# resources on continuing to continue those runs. This is what the concurrency.group
# value lets us express. When using merge queues, we now have to consider
# - runs triggers by commits per pull-request
# we want to cancel any previous run. So they should all get the same group (per PR)
# - runs refs/heads/gh-readonly-queue/<target branch name> (they should all get their
# unique git ref, we don't want to cancel any of the ones in the queue)
# - if it's neither, we fall back to the run_id (this is a unique number for each
# workflow run; it does not change if you "rerun" a job)
concurrency:
group: ${{ github.workflow }}-${{ github.event.type }}-${{ startsWith(github.ref, 'refs/heads/gh-readonly-queue/') && github.ref || github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2022-12-30"
STYLISH_HASKELL_VERSION: "0.14.4.0"
STYLISH_HASKELL_PATHS: >
cardano-testnet
cardano-git-rev
cardano-node
cardano-client-demo
cardano-node-chairman
cardano-tracer
trace-resources
cardano-node-capi
trace-dispatcher
trace-forward
cardano-cli
cardano-submit-api
steps:
- name: Download stylish-haskell
if: runner.os == 'Linux'
run: |
version="${{ env.STYLISH_HASKELL_VERSION }}"
curl -sL \
"https://github.com/haskell/stylish-haskell/releases/download/v$version/stylish-haskell-v$version-linux-x86_64.tar.gz" \
| tar -C "/tmp" -xz
echo "PATH=/tmp/stylish-haskell-v$version-linux-x86_64:$PATH" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Run stylish-haskell over all Haskell files
run: |
git add .
git stash
for x in $(git ls-tree --full-tree --name-only -r HEAD ${{ env.STYLISH_HASKELL_PATHS }}); do
if [ "${x##*.}" == "hs" ]; then
stylish-haskell -i $x
fi
done
git --no-pager diff
- name: Run stylish-haskell over all modified files
run: |
git add .
git stash
git fetch origin ${{ github.base_ref }} --unshallow
for x in $(git diff --name-only ${{ github.base_ref }} HEAD ${{ env.STYLISH_HASKELL_PATHS }}); do
if [ "${x##*.}" == "hs" ]; then
stylish-haskell -i $x
fi
done
git --no-pager diff --exit-code