Skip to content

Commit

Permalink
Merge request #88 add CI Cabal build functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton-Latukha authored Dec 15, 2020
2 parents 4a1c1a2 + ac92f1d commit d8db986
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/Cabal-Linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Hackage, Cabal, Linux"

on:
pull_request:
push:
branches:
- master
schedule:
- cron: "45 02 * * *"


jobs:

build10:
name: "GHC"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
packageRoot: [ hnix-store-core, hnix-store-remote ]
ghc: [ "8.10", "8.4" ]
defaults:
run:
working-directory: "./${{ matrix.packageRoot }}"
steps:
- uses: actions/checkout@v2
- name: "Cache of ~/.cabal/packages, ~/.cabal/store and dist-newstyle"
uses: actions/cache@v2
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: "${{ runner.os }}-Cabal-${{ matrix.ghc }}"
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
- name: "Install additional system packages"
run: sudo apt install libsodium-dev
- run: cabal v2-install tasty-discover
- name: "Install Nix"
# Still required for Store-remote test suite run
uses: cachix/install-nix-action@v12
if: matrix.packageRoot == 'hnix-store-remote'
- run: cabal v2-configure --disable-optimization --enable-tests --enable-deterministic
if: matrix.packageRoot == 'hnix-store-core'
- run: |
cabal v2-configure --disable-optimization --enable-tests --enable-deterministic \
-f io-testsuite # Enable the Store-remote test suite
if: matrix.packageRoot == 'hnix-store-remote'
- run: cabal v2-build
- run: cabal v2-test
51 changes: 51 additions & 0 deletions .github/workflows/On-Release-Cabal-Linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Release testing, Hackage, Cabal, Linux"

on:
release:
# created: a draft is saved, or a release or pre-release is published without previously being saved as a draft
types: [ created ]

jobs:

build10:
name: "GHC"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
packageRoot: [ hnix-store-core, hnix-store-remote ]
# Since CI by default tests boundary GHCs, test middle versions of GHCs
ghc: [ "8.8", "8.6"]
defaults:
run:
working-directory: "./${{ matrix.packageRoot }}"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache of ~/.cabal/packages, ~/.cabal/store and dist-newstyle
uses: actions/cache@v2
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-Cabal-${{ matrix.ghc }}
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
- name: "Install additional system packages"
run: sudo apt install libsodium-dev
- run: cabal v2-install tasty-discover
- name: "Install Nix"
# Still required for Store-remote test suite run
uses: cachix/install-nix-action@v12
if: matrix.packageRoot == 'hnix-store-remote'
- run: cabal v2-configure --disable-optimization --enable-tests --enable-deterministic
if: matrix.packageRoot == 'hnix-store-core'
- run: |
cabal v2-configure --disable-optimization --enable-tests --enable-deterministic \
-f io-testsuite # Enable the Store-remote test suite
if: matrix.packageRoot == 'hnix-store-remote'
- run: cabal v2-build
- run: cabal v2-test

0 comments on commit d8db986

Please sign in to comment.