forked from ghc/ghc
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (86 loc) · 2.59 KB
/
ci-cabal-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
types:
- opened
- synchronize
push:
branches: [master]
jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc: ['9.8.4'] # bootstrapping compiler
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: haskell/ghcup-setup@v1
- id: ghcup
run: |
ghcup config set cache true
echo "basedir=$(ghcup whereis basedir)" >> $GITHUB_OUTPUT
- id: ghcup-cache
name: Cache GHCup basedir
uses: actions/cache@v4
with:
key: ghcup-basedir-${{ github.run_id }}
restore-keys: ghcup-basedir-
path: ${{ steps.ghcup.outputs.basedir }}
- run: |
ghcup install ghc --set ${{ matrix.ghc }}
ghcup install cabal --set
- id: cabal-paths
run: |
cabal user-config init
echo "store=$(cabal path --store-dir)" >> $GITHUB_OUTPUT
echo "remote-repo-cache=$(cabal path --remote-repo-cache)" >> $GITHUB_OUTPUT
- name: Restore Hackage index
uses: actions/cache/restore@v4
with:
key: hackage-${{ github.run_id }}
restore-keys: hackage-
path: ${{ steps.cabal-paths.outputs.remote-repo-cache }}
- run: cabal update
- name: Restore build artifacts
uses: actions/cache/restore@v4
with:
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ github.run_id }}
restore-keys: ${{ matrix.os }}-${{ matrix.ghc }}-
path: |
${{ steps.cabal-paths.outputs.store }}
libraries/Cabal/dist-newstyle
_build
- name: Build stage1
run: make stage1
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: stage1
path: _stage1
- name: Save GHCup cache
uses: actions/cache/save@v4
if: always()
with:
key: ghcup-${{ github.run_id }}
path: ${{ steps.ghcup.outputs.cachedir }}
- name: Save Hackage index
uses: actions/cache/save@v4
if: always()
with:
key: hackage-${{ github.run_id }}
path: ${{ steps.cabal-paths.outputs.remote-repo-cache }}
- name: Save build artifacts
if: always()
uses: actions/cache/save@v4
with:
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ github.run_id }}
path: |
${{ steps.cabal-paths.outputs.store }}
libraries/Cabal/dist-newstyle
_build