-
Notifications
You must be signed in to change notification settings - Fork 151
59 lines (47 loc) · 1.35 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
name: CI
on: ['pull_request', 'push']
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
ghc: ["9.4", "9.6", "9.8"]
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
- uses: actions/cache@v3
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('*.cabal') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-v1-
- run: make build
- run: make test
- if: startsWith(github.ref, 'refs/tags') && matrix.ghc == '9.6'
run: make artifact
- uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags') && matrix.ghc == '9.6'
with:
path: artifacts/*
name: artifacts-${{ runner.os }}
release:
name: Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
pattern: artifacts-*
- run: ls -R
- run: 'sha256sum artifacts-*/*'
- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: 'artifacts-*/stylish-haskell-*'