Skip to content

Commit d66ed76

Browse files
CI: Cabal: add macOS (#114)
The Core is works, the Remote code awaits the according to project to compile on macOS.
1 parent 3068acd commit d66ed76

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/Cabal-macOS.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "Hackage, Cabal, macOS"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: "45 03 * * *"
10+
11+
env:
12+
cabalConfig: --enable-tests --disable-optimization --enable-deterministic
13+
14+
jobs:
15+
16+
# 2021-03-12: NOTE: Please, enable uncommented working code when `remote` builds on macOS.
17+
build10:
18+
name: "GHC"
19+
runs-on: macos-latest
20+
strategy:
21+
matrix:
22+
packageRoot: [ hnix-store-core ]
23+
# packageRoot: [ hnix-store-core, hnix-store-remote ]
24+
defaults:
25+
run:
26+
working-directory: "./${{ matrix.packageRoot }}"
27+
steps:
28+
29+
- name: "Git checkout"
30+
uses: actions/checkout@v2
31+
with:
32+
submodules: recursive
33+
34+
- name: "Haskell env setup"
35+
id: HaskEnvSetup
36+
uses: haskell/actions/setup@v1
37+
with:
38+
ghc-version: '8.10'
39+
40+
- name: "Repository update"
41+
run: cabal v2-update
42+
43+
- name: "Install additional system packages"
44+
run: cabal v2-install tasty-discover
45+
46+
# # Still required for Remote
47+
# - name: "Install Nix"
48+
# uses: cachix/install-nix-action@v12
49+
# if: matrix.packageRoot == 'hnix-store-remote'
50+
51+
# # Remote: Enabling testsuite, because it requires networking in the default Nix environment.
52+
# - name: "Project-specific Cabal configuration"
53+
# if: matrix.packageRoot == 'hnix-store-remote'
54+
# run: echo "cabalConfig=$cabalConfig -f io-testsuite" >> $GITHUB_ENV
55+
56+
# NOTE: Freeze is for the caching
57+
- name: "Configuration freeze"
58+
run: cabal v2-freeze $cabalConfig
59+
60+
- name: "Copy freeze file to the root dir"
61+
run: cp -a cabal.project.freeze ../cabal.project.freeze
62+
63+
- name: "Configuring GitHub cache"
64+
uses: actions/cache@v2
65+
with:
66+
path: |
67+
${{ steps.HaskEnvSetup.outputs.cabal-store }}
68+
dist-newstyle
69+
key: ${{ matrix.packageRoot }}-${{ runner.os }}-Cabal-${{ hashFiles( 'cabal.project.freeze' ) }}
70+
restore-keys: ${{ matrix.packageRoot }}-${{ runner.os }}-Cabal-
71+
72+
- name: "Build"
73+
run: cabal v2-build $cabalConfig
74+
75+
- name: "Tests"
76+
run: cabal v2-test $cabalConfig

0 commit comments

Comments
 (0)