-
Notifications
You must be signed in to change notification settings - Fork 2
167 lines (139 loc) · 4.59 KB
/
ghc.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: GHC (build, test, haddock)
# Controls when the workflow will run
on:
push:
branches: [master]
tags: [v*]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write # to submit Haddock documentation to GitHub Pages
jobs:
check:
name: "Run static checks"
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
- uses: haskell-actions/run-fourmolu@v10
with:
version: "0.14.0.0"
pattern: |
eo-phi-normalizer/**/*.hs
!eo-phi-normalizer/src/Language/EO/Phi/Syntax/**/*.hs
!eo-phi-normalizer/Setup.hs
- uses: haskell-actions/hlint-setup@v2
- name: Get hlint-bin
id: get-hlint-bin
run: |
chmod +x scripts/run-hlint.sh
echo "hlint-bin=$(realpath scripts/run-hlint.sh)" >> $GITHUB_OUTPUT
- uses: haskell-actions/hlint-run@v2
with:
hlint-bin: ${{ steps.get-hlint-bin.outputs.hlint-bin }}
pipeline:
name: Run pipeline
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: 🧰 Setup Stack
# TODO #208:10m replace with freckle/stack-action after https://github.com/freckle/stack-action/pull/69 is merged
uses: deemp/stack-action@main
with:
stack-build-arguments: ${{ github.ref_name != 'master' && '--fast' || '' }} --pedantic
# TODO #213:10m enable macos test after https://github.com/objectionary/normalizer/issues/180 is resolved
# TODO #98:10m enable windows tests after https://github.com/objectionary/normalizer/issues/185 is resolved
test: ${{ matrix.os != 'windows-latest' && matrix.os != 'macos-latest'}}
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 21
- name: Run pipeline
shell: bash
run: ./scripts/pipeline.sh
- name: Upload pipeline artifact
id: pipeline-artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: pipeline-${{ runner.os }}-${{ hashFiles('pipeline/eo/*.eo') }}
overwrite: true
path: |
pipeline
!pipeline/**/.eoc
!pipeline/yaml
report
- name: Write about the artifact in the job summary
if: always()
shell: bash
run: |
cat << EOF >> $GITHUB_STEP_SUMMARY
<h2>Artifact</h2>
<p>
EO and PHI files that participated in the pipeline
are in the artifact
<a href="${{ steps.pipeline-artifact.outputs.artifact-url }}">
pipeline-${{ hashFiles('pipeline/eo/*.eo') }}
</a>.
</p>
EOF
- name: Write the report in the job summary
if: success()
shell: bash
run: |
cat report/report.md >> $GITHUB_STEP_SUMMARY
docs:
needs: pipeline
if: ${{ github.ref_name == 'master' }}
name: "Build and upload site (master)"
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
- name: 🧰 Setup Stack
# TODO #208:10m replace with freckle/stack-action after https://github.com/freckle/stack-action/pull/69 is merged
uses: deemp/stack-action@main
with:
test: false
stack-build-arguments: --fast --haddock
- name: Download pipeline artifact
uses: actions/download-artifact@v4
with:
pattern: pipeline-${{ runner.os }}-*
merge-multiple: true
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"
- name: Build site
run: |
ROOT=$PWD
mkdir -p dist/haddock
mv $(stack path --local-doc-root)/* dist/haddock
cd site/docs
mdbook build
mv docs ../../dist
cd ../..
cd site
mv index.html ../dist
cd ..
mkdir -p dist/report
cp report/report.html dist/report/index.html
- name: 🚀 Publish Site
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: dist
single-commit: true