mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-12-01 07:10:26 +03:00
b787344708
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.2 to 3.3.0. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.2.2...v3.3.0) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
73 lines
2.2 KiB
YAML
73 lines
2.2 KiB
YAML
name: "Hackage, Cabal, Linux"
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
schedule:
|
|
- cron: "45 02 * * *"
|
|
|
|
env:
|
|
cabalConfig: --enable-tests --disable-optimization --enable-deterministic
|
|
|
|
jobs:
|
|
|
|
build10:
|
|
name: "GHC"
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
# Separation between Core & Store workflows made deliberately, so when one fixes Core, CI does not falls because of the Hackage Core Remote builds with.
|
|
# 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.
|
|
packageRoot: [ hnix-store-core ]
|
|
ghc: [ "9.0", "8.6" ]
|
|
defaults:
|
|
run:
|
|
working-directory: "./${{ matrix.packageRoot }}"
|
|
steps:
|
|
|
|
- name: "Git checkout"
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: "Haskell env setup"
|
|
id: HaskEnvSetup
|
|
uses: haskell/actions/setup@v2
|
|
with:
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
- name: "Repository update"
|
|
run: cabal v2-update
|
|
|
|
- name: "Install additional system packages"
|
|
run: sudo apt install libsodium-dev
|
|
|
|
# NOTE: Freeze is for the caching
|
|
- name: "Configuration freeze"
|
|
run: cabal v2-freeze $cabalConfig
|
|
|
|
- name: "Hack: Copy freeze file to the root dir"
|
|
run: cp -a cabal.project.freeze ../cabal.project.freeze
|
|
|
|
- name: "Configuring GitHub cache"
|
|
uses: actions/cache@v3.3.0
|
|
with:
|
|
path: |
|
|
${{ steps.HaskEnvSetup.outputs.cabal-store }}
|
|
dist-newstyle
|
|
key: ${{ matrix.packageRoot }}-${{ runner.os }}-Cabal-${{ matrix.ghc }}-${{ hashFiles( 'cabal.project.freeze' ) }}
|
|
# 2022-04-22: `v2-` added to invalidate corrupted caches, can be removed after one week
|
|
restore-keys: ${{ matrix.packageRoot }}-${{ runner.os }}-Cabal-${{ matrix.ghc }}-v2-
|
|
|
|
- name: "Build"
|
|
run: cabal v2-build $cabalConfig
|
|
|
|
- name: "Tests"
|
|
run: cabal v2-test $cabalConfig
|
|
|
|
- name: "Source distribution file"
|
|
if: ${{ matrix.ghc == '9.0' }}
|
|
run: cabal v2-sdist
|