-
Notifications
You must be signed in to change notification settings - Fork 50
146 lines (116 loc) · 5.15 KB
/
ci.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
push:
branches: [ master ]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ master ]
paths-ignore:
- '**/*.md'
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Prepare git
run:
git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/ &&
git config --global url."http://github.com/ghc/packages-".insteadOf http://github.com/ghc/packages/ &&
git config --global url."https://github.com/ghc/packages-".insteadOf https://github.com/ghc/packages/ &&
git config --global url."ssh://[email protected]/ghc/packages-".insteadOf ssh://[email protected]/ghc/packages/ &&
git config --global url."[email protected]:ghc/packages-".insteadOf [email protected]:ghc/packages/
- name: Checkout GHC
uses: actions/[email protected]
with:
repository: ghc/ghc
submodules: recursive
- name: Checkout ghc.nix
uses: actions/[email protected]
with:
path: ghc.nix
- name: Install nix
uses: cachix/install-nix-action@v20
- name: Use cachix
uses: cachix/cachix-action@v12
with:
name: ghc-nix
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- name: Check nix flake
run: nix flake check ghc.nix# -Lv --impure --fallback
- name: Run nix-shell - Boot and Configure
run: nix-shell --pure ghc.nix/shell.nix --command "./boot && configure_ghc"
- name: Run nix-shell - Build Hadrian
run: nix-shell --pure ghc.nix/shell.nix --command "pushd hadrian; cabal new-update; cabal new-build -j all; popd"
- name: Run nix-shell - hadrian/ghci
run: nix-shell --pure ghc.nix/shell.nix --command "echo :q | hadrian/ghci | tail -n2 | grep 'Ok,'"
- name: Run nix-shell - Build GHC
run: nix-shell --pure ghc.nix/shell.nix --command "hadrian/build -j --flavour=quickest"
- name: Run nix-shell - Test GHC (by running a testsuite subset)
run: nix-shell --pure ghc.nix/shell.nix --command "hadrian/build -j --flavour=quickest test --test-root-dirs=testsuite/tests/programs"
- name: Run nix develop - Boot and Configure
run: nix develop -Lv --fallback ghc.nix# -c bash -c "./boot && configure_ghc"
- name: Run nix develop - Build Hadrian
run: nix develop -Lv --fallback ghc.nix# -c bash -c "pushd hadrian; cabal new-update; cabal new-build -j all; popd"
- name: Run nix develop - hadrian/ghci
run: nix develop -Lv --fallback ghc.nix# -c bash -c "echo :q | hadrian/ghci | tail -n2 | grep 'Ok,'"
- name: Run nix develop - Build GHC
run: nix develop -Lv --fallback ghc.nix# -c bash -c "hadrian/build -j --flavour=quickest"
- name: Run nix develop - Test GHC (by running a testsuite subset)
run: nix develop -Lv --fallback ghc.nix# -c bash -c "hadrian/build -j --flavour=quickest test --test-root-dirs=testsuite/tests/programs"
- name: Setup pages
id: pages
uses: actions/configure-pages@v3
- name: build book
run: nix build -Lv --fallback ghc.nix#moduleDocs
- name: upload-artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./result
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
cross_compiler_smoketest:
runs-on: ubuntu-latest
steps:
- name: Prepare git
run:
git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/ &&
git config --global url."http://github.com/ghc/packages-".insteadOf http://github.com/ghc/packages/ &&
git config --global url."https://github.com/ghc/packages-".insteadOf https://github.com/ghc/packages/ &&
git config --global url."ssh://[email protected]/ghc/packages-".insteadOf ssh://[email protected]/ghc/packages/ &&
git config --global url."[email protected]:ghc/packages-".insteadOf [email protected]:ghc/packages/
- name: Checkout GHC
uses: actions/[email protected]
with:
repository: ghc/ghc
submodules: recursive
- name: Checkout ghc.nix
uses: actions/[email protected]
with:
path: ghc.nix
- name: Install nix
uses: cachix/install-nix-action@v20
- name: Use cachix
uses: cachix/cachix-action@v12
with:
name: ghc-nix
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- name: "wasm-cross: Run nix develop - Boot and Configure"
run:
nix develop -Lv --fallback ghc.nix#wasm-cross -c bash -c "./boot && configure_ghc"
- name: "wasm-cross: Check backward compat synonym"
run:
nix develop -Lv --fallback ghc.nix#wasi-cross -c true
- name: "js-cross: Run nix develop - Boot and Configure"
run: nix develop -Lv --fallback ghc.nix#js-cross -c bash -c "./boot && configure_ghc"