-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (131 loc) · 3.92 KB
/
workflow.yaml
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
jobs:
build:
name: Build on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}-${{ matrix.version }}
steps:
- uses: actions/checkout@v4
- run: mkdir artifact
- id: haskell
uses: haskell-actions/setup@v2
with:
ghc-version: '9.10'
- run: ghc-pkg list
- run: cabal sdist --output-dir artifact
- run: cabal configure --enable-optimization=2 --enable-tests --flags pedantic --jobs
- run: cat cabal.project.local
- run: cp cabal.project.local artifact
- run: cabal freeze
- run: cat cabal.project.freeze
- run: cp cabal.project.freeze artifact
- run: cabal outdated --v2-freeze-file
- uses: actions/cache@v4
with:
key: ${{ matrix.platform }}/${{ hashFiles('cabal.project.freeze') }}
path: ${{ steps.haskell.outputs.cabal-store }}
restore-keys: ${{ matrix.platform }}/
- run: cabal build --only-download
- run: cabal build --only-dependencies
- run: cabal build
- run: cp $( cabal list-bin monadoc ) artifact
- uses: actions/upload-artifact@v4
with:
name: monadoc-${{ matrix.platform }}-${{ github.sha }}
path: artifact
- run: echo ::add-matcher::.github/hspec-problem-matcher.json
- run: cabal run -- monadoc-test-suite --randomize --strict
strategy:
matrix:
include:
- platform: macos
version: 14
- platform: ubuntu
version: 22.04
- platform: windows
version: 2022
cabal:
name: Cabal
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: cabal check
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
name: Deploy
needs: docker
secrets: inherit
uses: ./.github/workflows/deploy.yaml
docker:
if: ${{ github.event_name != 'schedule' }}
name: Docker
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: monadoc-ubuntu-${{ github.sha }}
path: artifact
- run: cd artifact && tar xf monadoc-*.tar.gz
- run: mv artifact/monadoc-*/data artifact/monadoc docker
- run: chmod +x docker/monadoc
- id: meta
uses: docker/metadata-action@v5
with:
flavor: latest=false
images: ghcr.io/${{ github.repository }}
tags: type=sha,format=long
- uses: docker/login-action@v3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
- uses: docker/build-push-action@v6
with:
build-args: MONADOC_COMMIT_SHA=${{ github.sha }}
context: docker
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}
fly:
name: Fly
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be
- env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_APP_NAME: green-hill-3802
run: flyctl config validate --app $FLY_APP_NAME
gild:
name: Gild
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: tfausak/cabal-gild-setup-action@v2
with:
version: 1.5.0.1
- run: cabal-gild --input monadoc.cabal --mode check
hlint:
name: HLint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/hlint-setup@v2
with:
version: 3.8
- uses: haskell-actions/hlint-run@v2
with:
fail-on: status
ormolu:
name: Ormolu
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/run-ormolu@v16
with:
version: 0.7.7.0
name: Workflow
on:
push: null
schedule:
- cron: 0 0 * * 1