2021-03-12 21:14:14 +03:00
|
|
|
name: "Hackage, Cabal, macOS"
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
schedule:
|
|
|
|
- cron: "45 03 * * *"
|
|
|
|
|
|
|
|
env:
|
|
|
|
cabalConfig: --enable-tests --disable-optimization --enable-deterministic
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build10:
|
|
|
|
name: "GHC"
|
|
|
|
runs-on: macos-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
packageRoot: [ hnix-store-core ]
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: "./${{ matrix.packageRoot }}"
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: "Git checkout"
|
2022-03-02 14:26:52 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-03-12 21:14:14 +03:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: "Haskell env setup"
|
|
|
|
id: HaskEnvSetup
|
2022-04-21 14:23:23 +03:00
|
|
|
uses: haskell/actions/setup@v2
|
2021-03-12 21:14:14 +03:00
|
|
|
with:
|
2021-08-06 17:42:41 +03:00
|
|
|
ghc-version: '9.0'
|
2021-03-12 21:14:14 +03:00
|
|
|
|
|
|
|
- name: "Repository update"
|
|
|
|
run: cabal v2-update
|
|
|
|
|
|
|
|
- name: "Install additional system packages"
|
|
|
|
run: cabal v2-install tasty-discover
|
|
|
|
|
|
|
|
# NOTE: Freeze is for the caching
|
|
|
|
- name: "Configuration freeze"
|
|
|
|
run: cabal v2-freeze $cabalConfig
|
|
|
|
|
|
|
|
- name: "Copy freeze file to the root dir"
|
|
|
|
run: cp -a cabal.project.freeze ../cabal.project.freeze
|
|
|
|
|
|
|
|
- name: "Configuring GitHub cache"
|
2022-03-30 14:27:49 +03:00
|
|
|
uses: actions/cache@v3.0.1
|
2021-03-12 21:14:14 +03:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ steps.HaskEnvSetup.outputs.cabal-store }}
|
|
|
|
dist-newstyle
|
|
|
|
key: ${{ matrix.packageRoot }}-${{ runner.os }}-Cabal-${{ hashFiles( 'cabal.project.freeze' ) }}
|
|
|
|
restore-keys: ${{ matrix.packageRoot }}-${{ runner.os }}-Cabal-
|
|
|
|
|
|
|
|
- name: "Build"
|
|
|
|
run: cabal v2-build $cabalConfig
|
|
|
|
|
|
|
|
- name: "Tests"
|
|
|
|
run: cabal v2-test $cabalConfig
|