name: The Juvix compiler CI on: workflow_dispatch: pull_request: branches: - main types: - opened - reopened - synchronize - ready_for_review - review_requested - closed concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: ormolu: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: mrkkrp/ormolu-action@v6 with: extra-args: >- --ghc-opt -XDerivingStrategies --ghc-opt -XImportQualifiedPost --ghc-opt -XMultiParamTypeClasses --ghc-opt -XStandaloneDeriving --ghc-opt -XTemplateHaskell --ghc-opt -XUnicodeSyntax hlint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: 'Set up HLint' uses: rwe/actions-hlint-setup@v1 with: version: '3.4' - name: 'Run HLint' uses: rwe/actions-hlint-run@v2.0.1 with: path: '["src/", "app/", "test/"]' fail-on: warning pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - uses: pre-commit/action@v3.0.0 with: extra_args: trailing-whitespace --all-files - uses: pre-commit/action@v3.0.0 with: extra_args: end-of-file-fixer --all-files - uses: pre-commit/action@v3.0.0 with: extra_args: check-yaml --all-files - uses: pre-commit/action@v3.0.0 with: extra_args: check-added-large-files --all-files - uses: pre-commit/action@v3.0.0 with: extra_args: check-case-conflict --all-files - uses: pre-commit/action@v3.0.0 with: extra_args: mixed-line-ending --all-files build: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest , macOS-latest] ghc: ["9.2.3"] steps: - uses: actions/cache@v3 name: Cache Stack id: cache env: cache-name: cache-env with: path: | ~/.stack main/.stack-work main/.hie key: ${{ runner.os }}-v1-build-${{ matrix.ghc }}-${{ hashFiles('main/src/**/*.hs', 'main/app/**/*.hs', 'main/test/**/*.hs', 'main/package.yaml', 'main/stack.yaml') }} restore-keys: | ${{ runner.os }}-v1-build-${{ matrix.ghc }}- ${{ runner.os }}-v1-build- ${{ runner.os }}-v1- - 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 submodules: true - name: Build Haskell Project run: | cd main make ci-build test: needs: build runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest , macOS-latest] ghc: ["9.2.3"] steps: - uses: actions/cache@v3 id: cache-build with: path: | ~/.stack main/.stack-work/ main/.hie key: ${{ runner.os }}-v1-build-${{ matrix.ghc }}- - name: Checkout the main repository uses: actions/checkout@v2 with: path: main submodules: recursive - 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 }} - 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 - name: Setup Wasmer uses: wasmerio/setup-wasmer@v1 - name: Test suite id: test run: | cd main make ci-test - name : Shell tests id: shell-tests if: matrix.os == 'ubuntu-latest' run : | cd main echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH make install make install-shelltest make test-shell docs: needs: build if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' strategy: matrix: os: [ubuntu-latest] ghc: ["9.2.3"] runs-on: ${{ matrix.os }} steps: - uses: actions/cache@v3 id: cache-build with: path: | ~/.stack main/.stack-work/ main/.hie key: ${{ runner.os }}-v1-build-${{ matrix.ghc }}- - name: Checkout our repository uses: actions/checkout@v2 with: path: main submodules: recursive - uses: r-lib/actions/setup-pandoc@v1 with: pandoc-version: '2.13' - name: MDBook setup uses: peaceiris/actions-mdbook@v1 with: mdbook-version: 'latest' - name: Generate Markdown files for each Org file run: | cd main make markdown-docs - name : Generate HTML files from milestone examples run : | cd main echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH make install make html-examples - name: Deploy HTML to github pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: main/_docs enable_jekyll: false cname: docs.juvix.org