1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-17 20:01:46 +03:00
juvix/.github/workflows/ci.yml
2022-04-04 15:55:15 +02:00

127 lines
2.9 KiB
YAML

name: MiniJuvix CI
on:
push:
branches: [ main , dev ]
pull_request:
branches:
- main
- dev
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest , macOS-latest ]
# Explicit GHC version, e.g."9.0.2", "8.10.7"
ghc: ["9.2.2"]
steps:
- uses: actions/cache@v2
name: Caching
id: cache
env:
cache-name: cache-env
with:
path: |
~/.stack
~/.cabal
dist-newstyle
main/.stack-work/
main/.hie
main/dist-newstyle
main/cabal-dev
key: ${{ runner.os }}-build-${{ matrix.ghc }}-${{ hashFiles('main/src/**') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.ghc }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: haskell/actions/setup@v1
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
stack-version: 'latest'
- name: Checkout our repository
uses: actions/checkout@v2
with:
path: main
- name: Build Haskell Project
run: |
cd main
make build
- name: Download MiniJuvix-stdlib
run: |
cd main
make minijuvix-stdlib
stack-test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macOS-latest , ubuntu-latest ]
ghc: ["9.2.2"]
steps:
- uses: actions/cache@v2
id: cache-build
with:
path: |
~/.stack
~/.cabal
dist-newstyle
main/.stack-work/
main/.hie
main/dist-newstyle
main/cabal-dev
key: ${{ runner.os }}-build-${{ matrix.ghc }}
- name: Checkout the main repository
uses: actions/checkout@v2
with:
path: main
- name: Test suite
id: stack-test
run: |
cd main
make test
ormolu:
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
ghc: ["9.2.2"]
steps:
- uses: actions/cache@v2
id: cache-build
with:
path: |
~/.stack
~/.cabal
dist-newstyle
main/.stack-work/
main/.hie
main/dist-newstyle
main/cabal-dev
key: ${{ runner.os }}-build-${{ matrix.ghc }}
- name: Checkout the main repository
uses: actions/checkout@v2
with:
path: main
- name: Build Ormolu
id: install-ormolu
run: |
cd main
stack install ormolu
- name: Stack build
id: check-ormolu
run: |
cd main
make check-ormolu