Skip to content

Commit 769dd6f

Browse files
committed
Add github CI
1 parent 508ebb8 commit 769dd6f

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/haskell.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: github-action
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
ghc: ['8.6', '8.8', '8.10', '9.0', '9.2', '9.4', '9.6', '9.8', '9.10']
11+
os: ['ubuntu-latest', 'macos-13'] # https://github.com/haskell-actions/setup/issues/77
12+
runs-on: ${{ matrix.os }}
13+
14+
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: haskell-actions/setup@v2
18+
with:
19+
ghc-version: ${{ matrix.ghc }}
20+
- name: Cache
21+
uses: actions/cache@v3
22+
env:
23+
cache-name: cache-cabal
24+
with:
25+
path: ~/.cabal
26+
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
27+
restore-keys: |
28+
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
29+
${{ runner.os }}-${{ matrix.ghc }}-build-
30+
${{ runner.os }}-${{ matrix.ghc }}-
31+
${{ runner.os }}
32+
33+
- name: Install system packages (linux)
34+
if: matrix.os == 'ubuntu-latest'
35+
run: |
36+
sudo apt-get update
37+
sudo apt install libsodium-dev
38+
39+
- name: Install system packages (macos)
40+
if: matrix.os == 'macos-13'
41+
run: |
42+
brew update
43+
brew install libsodium
44+
45+
- name: Set up cabal project file for CI
46+
run: cd lib && cp cabal.project.ci cabal.project
47+
48+
- name: Install dependencies
49+
run: |
50+
cabal update
51+
cd lib && cabal build --only-dependencies --enable-tests --enable-benchmarks all
52+
- name: Build obelisk libraries
53+
run: cd lib && cabal build --enable-tests --enable-benchmarks all
54+
- name: Run tests
55+
run: cd lib && cabal test all

lib/cabal.project.ci

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
packages:
2+
./executable-config/inject
3+
./executable-config/lookup
4+
./frontend
5+
./route
6+
./tabulation
7+
8+
if !arch(javascript)
9+
packages:
10+
./asset/manifest
11+
./asset/serve-snap
12+
./backend
13+
-- ./command
14+
./run
15+
-- ./selftest
16+
./snap-extras
17+
18+
import: cabal.dependencies.project

0 commit comments

Comments
 (0)