-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (105 loc) · 3.31 KB
/
ci.yaml
File metadata and controls
125 lines (105 loc) · 3.31 KB
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
name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
cabal:
strategy:
fail-fast: false
matrix:
ghc:
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.4"
- "9.10.1"
- "9.12.1"
platform:
- os: "macos-latest"
set-env: "export"
- os: "ubuntu-latest"
set-env: "export"
- os: "windows-latest"
set-env: "set"
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
- name: Configure
run: cabal configure --enable-tests --ghc-options -Werror
- name: Compile
run: cabal build
- name: Doctests
if: ${{ matrix.ghc == '9.8.4'
|| matrix.ghc == '9.10.1'
|| matrix.ghc == '9.12.1'
}}
run: |
echo "*** Installing doctest ***"
cabal install --ignore-project doctest --flag cabal-doctest
echo "*** Running doctest ***"
cabal doctest
- name: Unit Tests
run: cabal test unit --test-options '--hedgehog-tests 100000'
- name: Configure with arithmoi
run: cabal configure --project-file=cabal.arithmoi.project --enable-tests --ghc-options -Werror
- name: Compile with arithmoi
run: cabal build --project-file=cabal.arithmoi.project
- name: Unit Tests with arithmoi
run: cabal test unit --project-file=cabal.arithmoi.project --test-options '--hedgehog-tests 100000'
- name: Benchmarks
if: ${{ matrix.platform.os == 'ubuntu-latest' }}
id: bench
run: |
cabal bench --project-file=cabal.arithmoi.project --benchmark-options '
--csv benchmarks/${{ matrix.platform.os }}_${{ matrix.ghc }}_ci.csv
--svg benchmarks/${{ matrix.platform.os }}_${{ matrix.ghc }}_ci.svg
--baseline benchmarks/baseline_${{ matrix.platform.os }}_${{ matrix.ghc }}_ci.csv
--fail-if-slower 30
--fail-if-faster 30'
- uses: actions/upload-artifact@v4
if: ${{ failure() && steps.bench.conclusion == 'failure' }}
with:
name: build-artifacts
path: |
benchmarks/${{ matrix.platform.os }}_${{ matrix.ghc }}_ci.csv
benchmarks/${{ matrix.platform.os }}_${{ matrix.ghc }}_ci.svg
nix:
strategy:
fail-fast: false
matrix:
os:
- "macos-latest"
- "ubuntu-latest"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Compile & Test
run: nix build
lint:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Formatting
run: |
nix run .#format
git diff --exit-code --color=always
#- name: HLint
# run: nix run .#lint