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.
18 # only top level for these, because various test packages have them too
42 ghc: ["9.0.2", "9.2.8", "9.4.8", "9.6.6", "9.8.2"]
46 name: Bootstrap ${{ matrix.os }} ghc-${{ matrix.ghc }}
47 runs-on: ${{ matrix.os }}
49 - name: Work around XDG directories existence (haskell-actions/setup#62)
50 if: ${{ runner.os == 'macOS' }}
52 rm -rf ~/.config/cabal
55 - uses: actions/cache@v4
56 name: Cache the downloads
59 path: "/home/runner/work/cabal/cabal/_build"
60 key: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-${{ github.sha }}
61 restore-keys: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-
63 - uses: actions/checkout@v4
64 - uses: haskell-actions/setup@v2
66 ghc-version: ${{ matrix.ghc }}
70 GHC_VERSION=${{ matrix.ghc }}
71 # Fetch the bootstrap sources (we use linux dependencies also on macos)
72 python3 bootstrap/bootstrap.py -d bootstrap/linux-$GHC_VERSION.json fetch
74 # Bootstrap using the bootstrap sources
75 python3 bootstrap/bootstrap.py --bootstrap-sources bootstrap-sources.tar.gz
79 _build/bin/cabal --version
81 - uses: actions/upload-artifact@v4
83 name: cabal-${{ matrix.os }}-${{ matrix.ghc }}-bootstrapped
84 path: _build/artifacts/*
86 # We use this job as a summary of the workflow
87 # It will fail if any of the previous jobs does it
88 # This way we can use it exclusively in branch protection rules
89 # and abstract away the concrete jobs of the workflow, including their names
92 name: Bootstrap post job
93 runs-on: ubuntu-latest
94 # IMPORTANT! Any job added to the workflow should be added here too
99 echo "jobs info: ${{ toJSON(needs) }}"
100 - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')