Bump actions/checkout from 2 to 3 (#8597)
[cabal.git] / .github / workflows / bootstrap.yml
blob885b1916bc8d37c91d56eba2e3d745fb9fe58f53
1 name: Bootstrap
3 # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
4 concurrency:
5   group: ${{ github.ref }}-${{ github.workflow }}
6   cancel-in-progress: true
8 on:
9   push:
10     branches:
11       - master
12   pull_request:
13   release:
14     types:
15       - created
17 jobs:
18   bootstrap:
19     strategy:
20       matrix:
21         os: [ubuntu-latest]
22         ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2", "9.2.3"]
23         include:
24           - os: macos-latest
25             ghc: "9.2.3"
26     name: Bootstrap ${{ matrix.os }} ghc-${{ matrix.ghc }}
27     runs-on: ${{ matrix.os }}
28     steps:
29       - uses: actions/cache@v3
30         name: Cache the downloads
31         id: bootstrap-cache
32         with:
33           path: "/home/runner/work/cabal/cabal/_build"
34           key: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-${{ github.sha }}
35           restore-keys: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-
37       - uses: actions/checkout@v3
38       - name: bootstrap.py
39         run: |
40           GHC_VERSION=${{ matrix.ghc }}
41           ghcup config set cache true
42           ghcup install ghc $GHC_VERSION
44           # Fetch the bootstrap sources (we use linux dependencies also on macos)
45           python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc $GHC_VERSION) -d bootstrap/linux-$GHC_VERSION.json fetch
47           # Bootstrap using the bootstrap sources
48           python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc $GHC_VERSION) --bootstrap-sources bootstrap-sources.tar.gz
50       - name: Smoke test
51         run: |
52           _build/bin/cabal --version
54       - uses: actions/upload-artifact@v3
55         with:
56           name: cabal-${{ matrix.os }}-${{ matrix.ghc }}-bootstrapped
57           path: _build/artifacts/*