Skip to content

collateral balancing test #8310

collateral balancing test

collateral balancing test #8310

name: Check Stylish Haskell
on:
pull_request: # Required for workflows to be able to be approved from forks
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:
STYLISH_HASKELL_VERSION: "0.14.4.0"
STYLISH_HASKELL_PATHS: >
cardano-git-rev
cardano-node
cardano-node-capi
cardano-node-chairman
cardano-submit-api
cardano-testnet
cardano-tracer
trace-dispatcher
trace-forward
trace-resources
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 (always succeeds)
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
if grep -qE '^#' $x; then
echo "$x contains CPP. Skipping."
else
stylish-haskell -i $x
fi
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 --diff-filter=ACMR origin/${{ github.base_ref }}..HEAD ${{ env.STYLISH_HASKELL_PATHS }}); do
if [ "${x##*.}" == "hs" ]; then
if grep -qE '^#' $x; then
echo "$x contains CPP. Skipping."
else
stylish-haskell -i $x
fi
fi
done
git --no-pager diff --exit-code