workflow: fix bounds script #14
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: Haskell CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
plan: | |
- ghc: latest | |
allow-fail: true | |
- ghc: '9.10.1' | |
- ghc: '9.8.1' | |
- ghc: '9.6.1' | |
- ghc: '9.4.1' | |
- ghc: '9.2.5' | |
freeze: '20221124-ghc-9.2.5.freeze' | |
- ghc: '9.2.1' | |
- ghc: '9.0.1' | |
- ghc: '8.10.1' | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.plan.allow-fail == true }} | |
env: | |
FREEZE: ${{ matrix.plan.freeze }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/setup@v2 | |
id: cabal-setup-haskell | |
with: | |
ghc-version: ${{ matrix.plan.ghc }} | |
- name: Configure and freeze | |
run: | | |
set -ex | |
rm -f cabal.project.freeze | |
cabal v2-update | |
cabal v2-configure --enable-tests --enable-benchmarks --test-show-details=streaming | |
if [ "x" == "x$FREEZE" ]; then cabal v2-freeze; else cp freezes/$FREEZE cabal.project.freeze; fi | |
cat cabal.project.freeze | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.cabal-setup-haskell.outputs.cabal-store }} | |
key: ${{ runner.os }}-cabal-${{ hashFiles('cabal.project.freeze') }} | |
restore-keys: | | |
${{ runner.os }}-cabal- | |
- name: Install dependencies | |
run: cabal v2-build --only-dependencies all | |
- name: Build | |
run: cabal v2-build all | |
## - name: Haddock | |
## run: cabal v2-haddock all | |
- name: Test | |
run: cabal v2-test --jobs=1 all | |
- name: Prepare artifacts | |
run: | | |
mkdir output-artifacts | |
cp dist-newstyle/cache/plan.json output-artifacts/ | |
cp cabal.project.freeze output-artifacts/ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
name: plans-${{ matrix.plan.ghc }} | |
path: output-artifacts | |
bounds: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch cabal-plan-bounds | |
run: | | |
curl -L https://github.com/nomeata/cabal-plan-bounds/releases/latest/download/cabal-plan-bounds.linux.gz | gunzip > /usr/local/bin/cabal-plan-bounds | |
chmod +x /usr/local/bin/cabal-plan-bounds | |
- name: Make directories for work | |
run: mkdir -p input-artifacts output-artifacts/plans output-artifacts/freezes output-artifacts/cabals | |
- uses: actions/download-artifact@v4 | |
with: | |
path: input-artifacts/ | |
- name: Aggregate build plans | |
run: | | |
for d in input-artifacts/*; do | |
echo $d | |
plan_id=${d#input-artifacts/plans-} | |
echo $plan_id | |
mv $d/plan.json output-artifacts/plans/${plan_id}.json | |
mv $d/cabal.project.freeze output-artifacts/freezes/${plan_id}.freeze | |
done | |
- name: Modify cabals | |
run: | | |
p=fold-debounce | |
echo modify $p.cabal | |
cabal-plan-bounds -c $p.cabal output-artifacts/plans/*.json | |
git diff $p.cabal | |
cp $p.cabal output-artifacts/cabals/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: aggregated-plans | |
path: output-artifacts |