Skip to content

Commit 0081cf8

Browse files
committed
CI: GitHub: Cabal: split Core & Remote into separate workflows
Before: I fixed Core, but CI was falling due to Hackage Core failing in Remote build. This change reassambles of how they link togather versionally. M .github/workflows/Core-Cabal-Linux.yml
1 parent db71ece commit 0081cf8

File tree

3 files changed

+72
-13
lines changed

3 files changed

+72
-13
lines changed

.github/workflows/Cabal-Linux.yml renamed to .github/workflows/Cabal-Linux-Remote.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
packageRoot: [ hnix-store-core, hnix-store-remote ]
21+
packageRoot: [ hnix-store-remote ]
2222
ghc: [ "8.10", "8.4" ]
2323
defaults:
2424
run:
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
env:
12+
cabalConfig: --enable-tests --disable-optimization --enable-deterministic
13+
14+
jobs:
15+
16+
build10:
17+
name: "GHC"
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
# Separation between Core & Store workflows made deliberately, so when one fixes Core, CI does not falls because of the Hackage Core Remote builds with.
22+
# Also singleton also use is deliberate, it allows to reference the value in the further configuration & also leaves a name in the CI & preserves matrix flexibility for the future.
23+
packageRoot: [ hnix-store-core ]
24+
ghc: [ "8.10", "8.4" ]
25+
defaults:
26+
run:
27+
working-directory: "./${{ matrix.packageRoot }}"
28+
steps:
29+
30+
- name: "Git checkout"
31+
uses: actions/checkout@v2
32+
with:
33+
submodules: recursive
34+
35+
- name: "Haskell env setup"
36+
id: HaskEnvSetup
37+
uses: haskell/actions/setup@v1
38+
with:
39+
ghc-version: ${{ matrix.ghc }}
40+
41+
- name: "Repository update"
42+
run: cabal v2-update
43+
44+
- name: "Install additional system packages"
45+
run: sudo apt install libsodium-dev
46+
47+
# NOTE: Freeze is for the caching
48+
- name: "Configuration freeze"
49+
run: cabal v2-freeze $cabalConfig
50+
51+
- name: "Hack: Copy freeze file to the root dir"
52+
run: cp -a cabal.project.freeze ../cabal.project.freeze
53+
54+
- name: "Configuring GitHub cache"
55+
uses: actions/cache@v2
56+
with:
57+
path: |
58+
${{ steps.HaskEnvSetup.outputs.cabal-store }}
59+
dist-newstyle
60+
key: ${{ matrix.packageRoot }}-${{ runner.os }}-Cabal-${{ matrix.ghc }}-${{ hashFiles( 'cabal.project.freeze' ) }}
61+
restore-keys: ${{ matrix.packageRoot }}-${{ runner.os }}-Cabal-${{ matrix.ghc }}-
62+
63+
- name: "Build"
64+
run: cabal v2-build $cabalConfig
65+
66+
- name: "Tests"
67+
run: cabal v2-test $cabalConfig
68+
69+
- name: "Source distribution file"
70+
if: ${{ matrix.ghc == '8.10' }}
71+
run: cabal v2-sdist

.github/workflows/Cabal-macOS.yml renamed to .github/workflows/Core-Cabal-macOS.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ env:
1313

1414
jobs:
1515

16-
# 2021-03-12: NOTE: Please, enable uncommented working code when `remote` builds on macOS.
1716
build10:
1817
name: "GHC"
1918
runs-on: macos-latest
2019
strategy:
2120
matrix:
2221
packageRoot: [ hnix-store-core ]
23-
# packageRoot: [ hnix-store-core, hnix-store-remote ]
2422
defaults:
2523
run:
2624
working-directory: "./${{ matrix.packageRoot }}"
@@ -43,16 +41,6 @@ jobs:
4341
- name: "Install additional system packages"
4442
run: cabal v2-install tasty-discover
4543

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-
5644
# NOTE: Freeze is for the caching
5745
- name: "Configuration freeze"
5846
run: cabal v2-freeze $cabalConfig

0 commit comments

Comments
 (0)