2022-07-08 14:59:45 +03:00
|
|
|
name: The Juvix compiler CI
|
2021-12-04 15:25:15 +03:00
|
|
|
|
|
|
|
on:
|
2022-07-19 19:43:16 +03:00
|
|
|
workflow_dispatch:
|
2022-08-04 20:12:49 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2021-12-04 15:25:15 +03:00
|
|
|
pull_request:
|
2022-04-04 16:55:15 +03:00
|
|
|
branches:
|
|
|
|
- main
|
2022-05-20 11:45:03 +03:00
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- reopened
|
|
|
|
- synchronize
|
|
|
|
- ready_for_review
|
|
|
|
- review_requested
|
2022-05-23 17:56:59 +03:00
|
|
|
- closed
|
2022-05-20 11:45:03 +03:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
2021-12-04 15:25:15 +03:00
|
|
|
|
2022-08-03 15:44:48 +03:00
|
|
|
env:
|
|
|
|
STACKFLAGS: --pedantic
|
|
|
|
|
2021-12-04 15:25:15 +03:00
|
|
|
jobs:
|
2022-04-05 20:57:21 +03:00
|
|
|
ormolu:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-06-28 14:31:31 +03:00
|
|
|
- uses: mrkkrp/ormolu-action@v6
|
2022-04-05 20:57:21 +03:00
|
|
|
with:
|
|
|
|
extra-args: >-
|
|
|
|
--ghc-opt -XDerivingStrategies
|
|
|
|
--ghc-opt -XImportQualifiedPost
|
|
|
|
--ghc-opt -XMultiParamTypeClasses
|
|
|
|
--ghc-opt -XStandaloneDeriving
|
|
|
|
--ghc-opt -XTemplateHaskell
|
|
|
|
--ghc-opt -XUnicodeSyntax
|
|
|
|
|
2022-11-03 11:38:09 +03:00
|
|
|
clang-format:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: jidicula/clang-format-action@v4.9.0
|
|
|
|
with:
|
|
|
|
clang-format-version: '15'
|
|
|
|
check-path: 'runtime/src'
|
|
|
|
|
2022-04-05 20:57:21 +03:00
|
|
|
hlint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: 'Set up HLint'
|
|
|
|
uses: rwe/actions-hlint-setup@v1
|
|
|
|
with:
|
2022-06-13 15:25:22 +03:00
|
|
|
version: '3.4'
|
2022-04-05 20:57:21 +03:00
|
|
|
- name: 'Run HLint'
|
|
|
|
uses: rwe/actions-hlint-run@v2.0.1
|
|
|
|
with:
|
|
|
|
path: '["src/", "app/", "test/"]'
|
|
|
|
fail-on: warning
|
|
|
|
|
2022-05-20 11:45:03 +03:00
|
|
|
pre-commit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
2022-06-13 15:25:22 +03:00
|
|
|
- uses: pre-commit/action@v3.0.0
|
2022-05-20 11:45:03 +03:00
|
|
|
with:
|
|
|
|
extra_args:
|
|
|
|
trailing-whitespace --all-files
|
2022-06-13 15:25:22 +03:00
|
|
|
- uses: pre-commit/action@v3.0.0
|
2022-05-20 11:45:03 +03:00
|
|
|
with:
|
|
|
|
extra_args:
|
|
|
|
end-of-file-fixer --all-files
|
2022-06-13 15:25:22 +03:00
|
|
|
- uses: pre-commit/action@v3.0.0
|
2022-05-20 11:45:03 +03:00
|
|
|
with:
|
|
|
|
extra_args:
|
|
|
|
check-yaml --all-files
|
2022-06-13 15:25:22 +03:00
|
|
|
- uses: pre-commit/action@v3.0.0
|
2022-05-20 11:45:03 +03:00
|
|
|
with:
|
|
|
|
extra_args:
|
|
|
|
check-added-large-files --all-files
|
2022-06-13 15:25:22 +03:00
|
|
|
- uses: pre-commit/action@v3.0.0
|
2022-05-20 11:45:03 +03:00
|
|
|
with:
|
|
|
|
extra_args:
|
|
|
|
check-case-conflict --all-files
|
2022-06-13 15:25:22 +03:00
|
|
|
- uses: pre-commit/action@v3.0.0
|
2022-05-20 11:45:03 +03:00
|
|
|
with:
|
|
|
|
extra_args:
|
|
|
|
mixed-line-ending --all-files
|
|
|
|
|
2022-04-04 16:55:15 +03:00
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-11-03 11:38:09 +03:00
|
|
|
os: [ubuntu-latest]
|
2022-08-15 17:58:26 +03:00
|
|
|
ghc: ["9.2.4"]
|
2021-12-04 16:17:49 +03:00
|
|
|
steps:
|
2022-08-04 17:14:29 +03:00
|
|
|
- name: Checkout our repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: main
|
|
|
|
submodules: true
|
|
|
|
|
2022-04-05 20:57:21 +03:00
|
|
|
- uses: actions/cache@v3
|
2022-08-04 17:14:29 +03:00
|
|
|
name: Cache ~/.stack
|
2021-12-04 16:17:49 +03:00
|
|
|
with:
|
2022-08-04 17:14:29 +03:00
|
|
|
path: ~/.stack
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-global-${{ hashFiles('main/stack.yaml') }}-${{ hashFiles('main/package.yaml') }}
|
2022-04-04 16:55:15 +03:00
|
|
|
restore-keys: |
|
2022-08-04 17:14:29 +03:00
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-stack-global-
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Cache .stack-work
|
|
|
|
with:
|
|
|
|
path: main/.stack-work
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-work-${{ hashFiles('main/stack.yaml') }}-${{ hashFiles('main/package.yaml') }}-${{ hashFiles('main/**/*.hs') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-stack-work-
|
2022-04-04 16:55:15 +03:00
|
|
|
|
|
|
|
- uses: haskell/actions/setup@v1
|
|
|
|
name: Setup Haskell
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
enable-stack: true
|
|
|
|
stack-version: 'latest'
|
2021-12-04 16:17:49 +03:00
|
|
|
|
2022-11-03 11:38:09 +03:00
|
|
|
- name: Cache LLVM and Clang
|
|
|
|
id: cache-llvm
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
C:/Program Files/LLVM
|
|
|
|
./llvm
|
|
|
|
key: ${{ runner.os }}-llvm-13
|
|
|
|
|
|
|
|
- name: Install LLVM and Clang
|
|
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
|
|
with:
|
|
|
|
version: "13.0"
|
|
|
|
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
|
|
|
|
|
|
|
|
- name: Build Project
|
2021-12-04 16:17:49 +03:00
|
|
|
run: |
|
|
|
|
cd main
|
2022-08-03 15:44:48 +03:00
|
|
|
make build
|
2021-12-04 16:17:49 +03:00
|
|
|
|
2022-04-05 20:57:21 +03:00
|
|
|
test:
|
2022-04-04 16:55:15 +03:00
|
|
|
needs: build
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-11-03 11:38:09 +03:00
|
|
|
os: [ubuntu-latest]
|
2022-08-15 17:58:26 +03:00
|
|
|
ghc: ["9.2.4"]
|
2022-04-04 16:55:15 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout the main repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: main
|
2022-06-30 12:31:08 +03:00
|
|
|
submodules: recursive
|
2022-08-04 17:14:29 +03:00
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Cache ~/.stack
|
|
|
|
with:
|
|
|
|
path: ~/.stack
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-global-${{ hashFiles('main/stack.yaml') }}-${{ hashFiles('main/package.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-stack-global-
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Cache .stack-work
|
|
|
|
with:
|
|
|
|
path: main/.stack-work
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-work-${{ hashFiles('main/stack.yaml') }}-${{ hashFiles('main/package.yaml') }}-${{ hashFiles('main/**/*.hs') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-stack-work-
|
2022-06-20 13:53:31 +03:00
|
|
|
- name: Setup Stack GHC
|
|
|
|
run : |
|
|
|
|
cd main
|
|
|
|
stack setup
|
2022-05-16 18:17:28 +03:00
|
|
|
- name: Cache LLVM and Clang
|
|
|
|
id: cache-llvm
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
C:/Program Files/LLVM
|
|
|
|
./llvm
|
|
|
|
key: ${{ runner.os }}-llvm-13
|
|
|
|
- name: Install LLVM and Clang
|
|
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
|
|
with:
|
|
|
|
version: "13.0"
|
|
|
|
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
|
|
|
|
- name: Download and extract wasi-sysroot
|
|
|
|
run: |
|
|
|
|
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-15/wasi-sysroot-15.0.tar.gz -OL
|
|
|
|
tar xfv wasi-sysroot-15.0.tar.gz
|
|
|
|
- name: Download and extract libclang_rt.builtins-wasm32-wasi
|
|
|
|
run: |
|
|
|
|
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-15/libclang_rt.builtins-wasm32-wasi-15.0.tar.gz -OL
|
|
|
|
tar xfv libclang_rt.builtins-wasm32-wasi-15.0.tar.gz
|
|
|
|
working-directory: ${{ env.LLVM_PATH }}
|
|
|
|
- name: Set WASI_SYSROOT_PATH
|
|
|
|
run: |
|
|
|
|
echo "WASI_SYSROOT_PATH=$GITHUB_WORKSPACE/wasi-sysroot" >> $GITHUB_ENV
|
2022-05-05 16:12:17 +03:00
|
|
|
- name: Setup Wasmer
|
|
|
|
uses: wasmerio/setup-wasmer@v1
|
2022-04-04 16:55:15 +03:00
|
|
|
- name: Test suite
|
2022-04-05 20:57:21 +03:00
|
|
|
id: test
|
2022-04-04 16:55:15 +03:00
|
|
|
run: |
|
|
|
|
cd main
|
2022-08-03 15:44:48 +03:00
|
|
|
make test
|
2022-06-09 17:36:07 +03:00
|
|
|
- name : Shell tests
|
|
|
|
id: shell-tests
|
|
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
run : |
|
|
|
|
cd main
|
|
|
|
echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH
|
|
|
|
make test-shell
|
2022-07-15 14:52:16 +03:00
|
|
|
docs:
|
2022-07-19 19:43:16 +03:00
|
|
|
needs: build
|
|
|
|
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
|
2022-07-15 14:52:16 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
2022-08-15 17:58:26 +03:00
|
|
|
ghc: ["9.2.4"]
|
2022-07-15 14:52:16 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout our repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: main
|
|
|
|
submodules: recursive
|
|
|
|
|
2022-08-04 17:14:29 +03:00
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Cache ~/.stack
|
|
|
|
with:
|
|
|
|
path: ~/.stack
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-global-${{ hashFiles('main/stack.yaml') }}-${{ hashFiles('main/package.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-stack-global-
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Cache .stack-work
|
|
|
|
with:
|
|
|
|
path: main/.stack-work
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-work-${{ hashFiles('main/stack.yaml') }}-${{ hashFiles('main/package.yaml') }}-${{ hashFiles('main/**/*.hs') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-stack-work-
|
|
|
|
|
2022-07-15 14:52:16 +03:00
|
|
|
- uses: r-lib/actions/setup-pandoc@v1
|
|
|
|
with:
|
|
|
|
pandoc-version: '2.13'
|
|
|
|
|
|
|
|
- name: MDBook setup
|
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
with:
|
|
|
|
mdbook-version: 'latest'
|
|
|
|
|
2022-08-04 11:19:03 +03:00
|
|
|
- name: Setup Stack GHC
|
|
|
|
run : |
|
|
|
|
cd main
|
|
|
|
stack setup
|
|
|
|
|
|
|
|
- name: Cache LLVM and Clang
|
|
|
|
id: cache-llvm
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
C:/Program Files/LLVM
|
|
|
|
./llvm
|
|
|
|
key: ${{ runner.os }}-llvm-13
|
|
|
|
|
|
|
|
- name: Install LLVM and Clang
|
|
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
|
|
with:
|
|
|
|
version: "13.0"
|
|
|
|
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
|
|
|
|
|
2022-07-15 14:52:16 +03:00
|
|
|
- name: Generate Markdown files for each Org file
|
|
|
|
run: |
|
|
|
|
cd main
|
|
|
|
make markdown-docs
|
|
|
|
|
2022-08-03 17:14:38 +03:00
|
|
|
- name : Generate HTML and Web App files from milestone examples
|
2022-07-15 14:52:16 +03:00
|
|
|
run : |
|
|
|
|
cd main
|
|
|
|
echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH
|
|
|
|
make install
|
|
|
|
make html-examples
|
2022-08-03 17:14:38 +03:00
|
|
|
make webapp-examples
|
2022-07-15 14:52:16 +03:00
|
|
|
|
|
|
|
- name: Deploy HTML to github pages
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-07-15 18:20:31 +03:00
|
|
|
publish_dir: main/_docs
|
2022-07-15 14:52:16 +03:00
|
|
|
enable_jekyll: false
|
|
|
|
cname: docs.juvix.org
|