1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-22 23:23:06 +03:00

[ CI ] Add Haskell Github Action with Stack test and ormolu check

This commit is contained in:
Jonathan Prieto-Cubides 2022-04-04 15:55:15 +02:00
parent 22cf1cce99
commit eaad611bbf
6 changed files with 134 additions and 131 deletions

View File

@ -2,125 +2,125 @@ name: MiniJuvix CI
on:
push:
branches: [ master , develop , qtt ]
branches: [ main , dev ]
pull_request:
branches: [ master ]
branches:
- main
- dev
jobs:
docs:
runs-on: macOS-latest
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:
- name: Checkout the main repository
- 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
- uses: r-lib/actions/setup-pandoc@v1
with:
pandoc-version: '2.13'
- run: echo "# Test" | pandoc -t html
- name: Generate HTML
id: html
- name: Build Haskell Project
run: |
cd main
make docs
rm docs/README.md
make build
- name: Deploy HTML to github pages
if: steps.html.outputs.cache-hit != 'true'
uses: peaceiris/actions-gh-pages@v3
- 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:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: main/docs
enable_jekyll: true
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
# build:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ ubuntu-latest , macOS-latest ]
# ghc: ["8.10.7"]
# agda: ["2.6.2"]
# steps:
# - uses: actions/cache@v2
# name: Caching
# id: cache
# env:
# cache-name: cache-env
# with:
# path: |
# ~/.cabal
# dist-newstyle
# main/.hie
# main/dist-newstyle
# main/cabal-dev
# main/_build/
# main/.stack-work/
# agda/
# agda2hs/
# key: ${{ runner.os }}-build-${{ matrix.agda }}-${{ matrix.ghc }}-${{ hashFiles('main/src/**') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ matrix.agda }}-${{ matrix.ghc }}-
# ${{ runner.os }}-build-${{ matrix.agda }}-
# ${{ runner.os }}-
# - uses: haskell/actions/setup@v1
# name: Setup Haskell
# with:
# ghc-version: ${{ matrix.ghc }}
# - name: Add .cabal/bin into PATH
# run:
# echo "$HOME/.cabal/bin" >> $GITHUB_PATH
# shell: bash
# - uses: actions/checkout@v2
# name: Checkout Agda repository
# if: steps.cache.outputs.cache-hit != 'true'
# with:
# repository: agda/agda
# path: agda
# ref: ${{ matrix.agda }}
# - name: Install Agda
# if: steps.cache.outputs.cache-hit != 'true'
# run: |
# cd agda
# touch doc/user-manual.pdf
# cabal install --overwrite-policy=always --ghc-options='-O2 +RTS -M6G -RTS' -foptimise-heavily
# shell: bash
# - uses: actions/checkout@v2
# name: Checkout Agda2HS repository
# if: steps.cache.outputs.cache-hit != 'true'
# with:
# repository: agda/agda2hs
# path: agda2hs
# ref: ${{ matrix.agda }}
# - name: Install Agda2HS
# if: steps.cache.outputs.cache-hit != 'true'
# run: |
# cd agda2hs
# make install
# - name: Checkout our repository
# uses: actions/checkout@v2
# with:
# path: main
# - name: Verify the Agda files in it
# if: steps.cache.outputs.cache-hit != 'true'
# id: check-agda
# run: |
# cd main
# make agda
# - name: Build the Haskell project
# run: cabal update
# make cabal
# - name: Run tests
# run: cabal test all
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

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "minijuvix-stdlib"]
path = minijuvix-stdlib
url = git@github.com:heliaxdev/minijuvix-stdlib.git
url = https://github.com/heliaxdev/minijuvix-stdlib.git

View File

@ -67,6 +67,10 @@ test-watch:
format:
find . -path './src/**/*.hs' -or -path './app/**/*.hs' -exec ormolu --mode inplace {} --ghc-opt -XStandaloneDeriving --ghc-opt -XUnicodeSyntax --ghc-opt -XDerivingStrategies --ghc-opt -XMultiParamTypeClasses --ghc-opt -XTemplateHaskell \;
.PHONY: check-ormolu
check-ormolu:
find . -path './src/**/*.hs' -or -path './app/**/*.hs' -exec ormolu --mode check {} \;
.PHONY : install
install:
stack install --fast --jobs $(THREADS)
@ -78,6 +82,13 @@ install-watch:
repl:
stack ghci MiniJuvix:lib
prepare-push:
make checklines && make hlint && make format
make hlint && make format
.PHONY : update-submodules
update-submodules :
git submodule foreach git pull origin main
.PHONY : minijuvix-stdlib
minijuvix-stdlib:
git submodule update --init minijuvix-stdlib

View File

@ -12,7 +12,6 @@
</a>
#+end_html
** Description
MiniJuvix is a dependently functional programming language for writing
@ -49,18 +48,6 @@ If the installation succeeds, you must be able to run the =minijuvix=
command from any location. To get the complete list of commands, please
run =minijuvix --help=.
- How to install [[https://haskellstack.org][Stack]]:? if it's not
installed.
- For Ubuntu : =apt install stack=
- For Debian : =apt install haskell-stack=
- For Arch Linux : =pacman -S stack=
- For macOS : =brew install haskell-stack=
- For Windows, following the instructions
[[https://docs.haskellstack.org/en/stable/install_and_upgrade/#windows][here]].
It is required at least 8GB RAM for =stack= installation.
- To test everything works correctly, you can run the following command:
#+begin_src shell
@ -68,17 +55,21 @@ It is required at least 8GB RAM for =stack= installation.
#+end_src
** Emacs mode
There is an emacs mode available for MiniJuvix. Currently it supports syntax
highlighting for well-scoped modules. It is a work in progress.
To install it add the following lines to your emacs configuration file:
There is an Emacs mode available for MiniJuvix. Currently, it
supports syntax highlighting for well-scoped modules.
To install it add the following lines to your Emacs configuration file:
#+begin_src elisp
(push "/path/to/minijuvix/minijuvix-mode/" load-path)
(require 'minijuvix-mode)
#+end_src
Also, =minijuvix= must be installed in your =PATH=.
Make sure that =minijuvix= is installed in your =PATH=.
The MiniJuvix major mode will be activated automatically for =.mjuvix= files.
*** Keybindings
| Key | Function Name | Description |

View File

@ -18,8 +18,8 @@ parseMicroJuvixCommand :: Parser MicroJuvixCommand
parseMicroJuvixCommand =
hsubparser $
mconcat
[ commandPretty
, commandTypeCheck
[ commandPretty,
commandTypeCheck
]
where
commandPretty :: Mod CommandFields MicroJuvixCommand

View File

@ -1,4 +1,5 @@
ghc-options:
"$locals": -optP-Wno-nonportable-include-path
resolver: nightly-2022-03-23
allow-newer: true
extra-deps: []