Skip to content

Commit 965efc7

Browse files
committed
Add github CI
1 parent 508ebb8 commit 965efc7

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/haskell.yml

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