Skip to content

Commit efd688d

Browse files
committed
chore: added CI/CD workflow
1 parent c0bd51d commit efd688d

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
14+
strategy:
15+
matrix:
16+
ghc-version: ['9.10.3']
17+
cabal-version: ['3.10']
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Set up GHC ${{ matrix.ghc-version }}
26+
uses: haskell-actions/setup@v2
27+
with:
28+
ghc-version: ${{ matrix.ghc-version }}
29+
cabal-version: ${{ matrix.cabal-version }}
30+
enable-stack: false
31+
32+
- name: Cache Cabal store
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
~/.cabal/store
37+
~/.cabal/packages
38+
key: ${{ runner.os }}-cabal-${{ matrix.ghc-version }}-${{ hashFiles('cabal.project', 'pattern-lisp.cabal') }}
39+
restore-keys: |
40+
${{ runner.os }}-cabal-${{ matrix.ghc-version }}-
41+
42+
- name: Cache dist-newstyle
43+
uses: actions/cache@v4
44+
with:
45+
path: dist-newstyle
46+
key: ${{ runner.os }}-dist-${{ matrix.ghc-version }}-${{ hashFiles('**/*.hs', 'cabal.project', 'pattern-lisp.cabal') }}
47+
restore-keys: |
48+
${{ runner.os }}-dist-${{ matrix.ghc-version }}-
49+
50+
- name: Configure Cabal
51+
run: cabal update
52+
53+
- name: Build project
54+
run: cabal build --ghc-options="-Wall" all
55+
56+
- name: Run tests
57+
run: cabal test --test-show-details=direct all
58+
59+
- name: Build executable
60+
run: cabal build exe:pattern-lisp
61+

0 commit comments

Comments
 (0)