Skip to content

Commit

Permalink
ci: stack and wibbles
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcdonell committed Mar 1, 2023
1 parent 7f3afcc commit 4b0f5cb
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 11 deletions.
76 changes: 66 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: CI

# Trigger the workflow on push or pull request
on:
Expand All @@ -20,8 +20,8 @@ on:
- cron: '0 0 * * 0'

jobs:
build:
name: ${{ matrix.os }} ghc-${{ matrix.ghc }} ${{ matrix.mode }}
cabal:
name: cabal | ${{ matrix.os }}-${{ matrix.arch }} ghc-${{ matrix.ghc }} ${{ matrix.mode }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -45,10 +45,7 @@ jobs:
exclude:
- os: 'windows-latest'
mode: 'debug'
- os: 'windows-latest'
arch: "ARM64"
- os: 'ubuntu-latest'
arch: "ARM64"
- arch: "ARM64"

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -99,10 +96,10 @@ jobs:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.mode }}-${{ hashFiles('cabal.project.freeze') }}
key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.ghc }}-${{ matrix.mode }}-cabal-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.mode }}-${{ hashFiles('cabal.project.freeze') }}
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.mode }}-
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.ghc }}-${{ matrix.mode }}-cabal-${{ hashFiles('cabal.project.freeze') }}
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.ghc }}-${{ matrix.mode }}-cabal-
- name: Build dependencies
run: cabal build --only-dependencies
Expand All @@ -122,4 +119,63 @@ jobs:
run: cabal test nofib-interpreter
if: matrix.os != 'windows-latest'

stack:
name: stack | ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
- 'macOS-latest'
- 'windows-latest'
arch:
- "x64"
- "ARM64"
exclude:
- arch: "ARM64"

steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
repository: actions/cache
path: .github/actions/cache-always
ref: v3

# Tweak `action.yml` of `actions/cache@v3` to remove the `post-if`
# condition, making it default to `post-if: always ()`.
- name: Set up actions/cache-always@v3
run: |
sed -i -e '/ post-if: /d' .github/actions/cache-always/action.yml
- name: Set up Haskell
uses: haskell/actions/setup@v2
id: setup-haskell
with:
enable-stack: true
stack-no-global: true
stack-setup:ghc: true

- name: actions/cache-always@v3
uses: ./.github/actions/cache-always
with:
path: |
${{ steps.setup-haskell.outputs.stack-root }}
.stack-work
key: ${{ runner.os }}-${{ matrix.arch }}-stack-${{ hashFiles('stack.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-stack-${{ hashFiles('stack.yaml') }}
${{ runner.os }}-${{ matrix.arch }}-stack-
- name: Setup
run: stack setup

- name: Build dependencies
run: stack build --only-dependencies

- name: Build
run: stack build

# vi: nospell
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/accelerate-io/dist/
/.stack-work
/cabal.project.local*
/stack.yaml
/stack.yaml.lock
.DS_Store
*.lock
Expand Down
37 changes: 37 additions & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# https://docs.haskellstack.org/en/stable/yaml_configuration/

resolver: lts-20.12

packages:
- .

# extra-deps: []

# Override default flag values for local packages and extra-deps
# flags: {}

# Extra package databases containing global packages
# extra-package-dbs: []

# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=1.9"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor
#
# vim: nospell

0 comments on commit 4b0f5cb

Please sign in to comment.