3 # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
5 group: ${{ github.ref }}-${{ github.workflow }}
6 cancel-in-progress: true
8 # Note: This workflow file contains the required job "Bootstrap post job". We are using path filtering
9 # here to ignore PRs which only change documentation. This can cause a problem, see the workflow file
10 # "bootstrap.skip.yml" for a description of the problem and the solution provided in that file.
33 ghc: ["8.10.7", "9.0.2", "9.2.8", "9.4.8", "9.6.4", "9.8.2"]
37 name: Bootstrap ${{ matrix.os }} ghc-${{ matrix.ghc }}
38 runs-on: ${{ matrix.os }}
40 - name: Work around XDG directories existence (haskell-actions/setup#62)
41 if: ${{ runner.os == 'macOS' }}
43 rm -rf ~/.config/cabal
46 - uses: actions/cache@v3
47 name: Cache the downloads
50 path: "/home/runner/work/cabal/cabal/_build"
51 key: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-${{ github.sha }}
52 restore-keys: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-
54 - uses: actions/checkout@v4
55 - uses: haskell-actions/setup@v2
57 ghc-version: ${{ matrix.ghc }}
61 GHC_VERSION=${{ matrix.ghc }}
62 # Fetch the bootstrap sources (we use linux dependencies also on macos)
63 python3 bootstrap/bootstrap.py -d bootstrap/linux-$GHC_VERSION.json fetch
65 # Bootstrap using the bootstrap sources
66 python3 bootstrap/bootstrap.py --bootstrap-sources bootstrap-sources.tar.gz
70 _build/bin/cabal --version
72 - uses: actions/upload-artifact@v3
74 name: cabal-${{ matrix.os }}-${{ matrix.ghc }}-bootstrapped
75 path: _build/artifacts/*
77 # We use this job as a summary of the workflow
78 # It will fail if any of the previous jobs does it
79 # This way we can use it exclusively in branch protection rules
80 # and abstract away the concrete jobs of the workflow, including their names
83 name: Bootstrap post job
84 runs-on: ubuntu-latest
85 # IMPORTANT! Any job added to the workflow should be added here too
90 echo "jobs info: ${{ toJSON(needs) }}"
91 - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')