-
Notifications
You must be signed in to change notification settings - Fork 2
132 lines (110 loc) · 3.73 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
name: CI
on:
push:
branches: [master]
paths:
- 'docs/**/*.md'
- 'examples/**/*.purs'
- 'examples/**/*.js'
- 'src/**/*.purs'
- 'src/**/*.js'
- 'test/**/*.purs'
- 'test/**/*.js'
- '*.json'
- '*.dhall'
- 'scripts/check-docs.mjs'
- 'scripts/check-examples.mjs'
- '.github/workflows/ci.yml'
pull_request:
branches: [master]
paths:
- 'docs/**/*.md'
- 'examples/**/*.purs'
- 'examples/**/*.js'
- 'src/**/*.purs'
- 'src/**/*.js'
- 'test/**/*.purs'
- 'test/**/*.js'
- '*.json'
- '*.dhall'
- 'scripts/check-docs.mjs'
- 'scripts/check-examples.mjs'
- '.github/workflows/ci.yml'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up a PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"
purs-tidy: "latest"
- name: Cache PureScript dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
path: |
.spago
output
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Install PureScript dependencies
run: spago install
- name: Build source
run: spago build --no-install --purs-args '--censor-lib --strict'
- name: Run tests
run: spago -x test.dhall test
- name: Check formatting
run: purs-tidy check examples src test
- name: Install Node.js dependencies
run: npm install
- name: Check examples
run: npm run check-examples -- --color
- name: Check docs
run: npm run check-docs
- name: Verify Bower & Pulp
run: |
npm install bower [email protected]
npx bower install
npx pulp build -- --censor-lib --strict
- if: github.ref == 'refs/heads/master'
name: Dispatch tecton-halogen CI
run: |
curl -X POST https://api.github.com/repos/nsaunders/purescript-tecton-halogen/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.GH_ACCESS_TOKEN }} \
--data '{"event_type": "dependency_changed", "client_payload": { "repository": "'"$GITHUB_REPOSITORY"'" }}'
- if: github.ref == 'refs/heads/master'
id: count
name: Get test count
run: echo "value=$(spago -x test.dhall test | grep Summary -A1 | tail -n 1 | cut -d "/" -f2 | cut -d " " -f1)" >> $GITHUB_OUTPUT
- if: github.ref == 'refs/heads/master'
name: Update test count data
run: echo '{"schemaVersion":1,"label":"tests","message":"${{ steps.count.outputs.value }}","color":"cd523e"}' > meta/test-count.json
- if: github.ref == 'refs/heads/master'
name: Commit test count data update
uses: EndBug/add-and-commit@v9
with:
add: meta/test-count.json
author_name: GitHub Actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
message: Update test count.
- if: github.ref == 'refs/heads/master'
name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "0.4.12"
- if: github.ref == 'refs/heads/master'
name: Build docs
run: mdbook build
- if: github.ref == 'refs/heads/master'
name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book