Skip to content

Commit d8db986

Browse files
Merge request #88 add CI Cabal build functionality
2 parents 4a1c1a2 + ac92f1d commit d8db986

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

.github/workflows/Cabal-Linux.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Hackage, Cabal, Linux"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: "45 02 * * *"
10+
11+
12+
jobs:
13+
14+
build10:
15+
name: "GHC"
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
strategy:
19+
matrix:
20+
packageRoot: [ hnix-store-core, hnix-store-remote ]
21+
ghc: [ "8.10", "8.4" ]
22+
defaults:
23+
run:
24+
working-directory: "./${{ matrix.packageRoot }}"
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: "Cache of ~/.cabal/packages, ~/.cabal/store and dist-newstyle"
28+
uses: actions/cache@v2
29+
with:
30+
path: |
31+
~/.cabal/packages
32+
~/.cabal/store
33+
dist-newstyle
34+
key: "${{ runner.os }}-Cabal-${{ matrix.ghc }}"
35+
- uses: haskell/actions/setup@v1
36+
with:
37+
ghc-version: ${{ matrix.ghc }}
38+
- name: "Install additional system packages"
39+
run: sudo apt install libsodium-dev
40+
- run: cabal v2-install tasty-discover
41+
- name: "Install Nix"
42+
# Still required for Store-remote test suite run
43+
uses: cachix/install-nix-action@v12
44+
if: matrix.packageRoot == 'hnix-store-remote'
45+
- run: cabal v2-configure --disable-optimization --enable-tests --enable-deterministic
46+
if: matrix.packageRoot == 'hnix-store-core'
47+
- run: |
48+
cabal v2-configure --disable-optimization --enable-tests --enable-deterministic \
49+
-f io-testsuite # Enable the Store-remote test suite
50+
if: matrix.packageRoot == 'hnix-store-remote'
51+
- run: cabal v2-build
52+
- run: cabal v2-test
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Release testing, Hackage, Cabal, Linux"
2+
3+
on:
4+
release:
5+
# created: a draft is saved, or a release or pre-release is published without previously being saved as a draft
6+
types: [ created ]
7+
8+
jobs:
9+
10+
build10:
11+
name: "GHC"
12+
runs-on: ubuntu-latest
13+
continue-on-error: true
14+
strategy:
15+
matrix:
16+
packageRoot: [ hnix-store-core, hnix-store-remote ]
17+
# Since CI by default tests boundary GHCs, test middle versions of GHCs
18+
ghc: [ "8.8", "8.6"]
19+
defaults:
20+
run:
21+
working-directory: "./${{ matrix.packageRoot }}"
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
submodules: recursive
26+
- name: Cache of ~/.cabal/packages, ~/.cabal/store and dist-newstyle
27+
uses: actions/cache@v2
28+
with:
29+
path: |
30+
~/.cabal/packages
31+
~/.cabal/store
32+
dist-newstyle
33+
key: ${{ runner.os }}-Cabal-${{ matrix.ghc }}
34+
- uses: haskell/actions/setup@v1
35+
with:
36+
ghc-version: ${{ matrix.ghc }}
37+
- name: "Install additional system packages"
38+
run: sudo apt install libsodium-dev
39+
- run: cabal v2-install tasty-discover
40+
- name: "Install Nix"
41+
# Still required for Store-remote test suite run
42+
uses: cachix/install-nix-action@v12
43+
if: matrix.packageRoot == 'hnix-store-remote'
44+
- run: cabal v2-configure --disable-optimization --enable-tests --enable-deterministic
45+
if: matrix.packageRoot == 'hnix-store-core'
46+
- run: |
47+
cabal v2-configure --disable-optimization --enable-tests --enable-deterministic \
48+
-f io-testsuite # Enable the Store-remote test suite
49+
if: matrix.packageRoot == 'hnix-store-remote'
50+
- run: cabal v2-build
51+
- run: cabal v2-test

0 commit comments

Comments
 (0)