Idris2/.github/workflows/ci-idris2.yml

656 lines
22 KiB
YAML
Raw Normal View History

name: Idris2
on:
push:
branches:
- '*'
tags:
- '*'
paths-ignore:
- 'docs/**'
- 'icons/**'
- 'Release/**'
- '**.md'
- 'CONTRIBUTORS'
- 'LICENSE'
- '.github/workflows/ci-bootstrap.yml'
- '.github/workflows/ci-lint.yml'
- '.github/workflows/ci-sphinx.yml'
- '.github/workflows/ci-super-linter.yml'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- 'icons/**'
- 'Release/**'
- '**.md'
- 'CONTRIBUTORS'
- 'LICENSE'
- '.github/workflows/ci-bootstrap.yml'
- '.github/workflows/ci-lint.yml'
- '.github/workflows/ci-sphinx.yml'
- '.github/workflows/ci-super-linter.yml'
env:
IDRIS2_VERSION: 0.5.1 # For previous-version build
jobs:
initialise:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
with:
# for pull_request so we can do HEAD^2
fetch-depth: 2
- name: Get commit message
id: get_commit_message
run: |
if [[ '${{ github.event_name }}' == 'push' ]]; then
echo "::set-output name=commit_message::$(git log --format=%B -n 1 HEAD)"
elif [[ '${{ github.event_name }}' == 'pull_request' ]]; then
echo "::set-output name=commit_message::$(git log --format=%B -n 1 HEAD^2)"
fi
outputs:
commit_message:
echo "${{ steps.get_commit_message.outputs.commit_message }}"
######################################################################
# Build from the previous version
# We perform this check before all the other ones because:
# 1. It is fast
# 2. If it fails then there is no point in trying the rest
######################################################################
quick-check:
needs: initialise
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci: skip]')
env:
IDRIS2_CG: chez
SCHEME: scheme
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
# Get our hands on the released version either by using the cache
# or by rebuilding it if necessary.
- name: Cache Chez Previous Version
id: previous-version-cache
uses: actions/cache@v2
with:
path: Idris2-${{ env.IDRIS2_VERSION }}
key: ${{ runner.os }}-idris2-bootstrapped-chez-${{ env.IDRIS2_VERSION }}
- name : Build previous version
if: steps.previous-version-cache.outputs.cache-hit != 'true'
run: |
wget "https://www.idris-lang.org/idris2-src/idris2-$IDRIS2_VERSION.tgz"
tar zxvf "idris2-$IDRIS2_VERSION.tgz"
cd "Idris2-$IDRIS2_VERSION"
make bootstrap
cd ..
- name: Install previous version
run: |
cd "Idris2-$IDRIS2_VERSION"
make install
cd ..
# Build the current version and save the installation.
- name: Build current version
run: |
make && make install
- name: Artifact Idris2 from previous version
uses: actions/upload-artifact@v2
with:
name: ubuntu-installed-idris2-${{ env.IDRIS2_VERSION }}-chez
path: ~/.idris2/
######################################################################
# Bootstrapping builds
######################################################################
# CHEZ
ubuntu-bootstrap-chez:
needs: quick-check
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
env:
IDRIS2_CG: chez
SCHEME: scheme
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
- name: Make bootstrap folder readonly
run: chmod -R a-w bootstrap
- name: Build from bootstrap
run: make bootstrap && make install
- name: Artifact Bootstrapped Idris2
uses: actions/upload-artifact@v2
with:
name: ubuntu-installed-bootstrapped-idris2-chez
path: ~/.idris2/
macos-bootstrap-chez:
needs: quick-check
runs-on: macos-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: macos]')
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
env:
SCHEME: chez
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install build dependencies
run: |
brew install chezscheme
brew install coreutils
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
- name: Make bootstrap folder readonly
run: chmod -R a-w bootstrap
- name: Build Idris 2 from bootstrap
run: make bootstrap && make install
shell: bash
- name: Artifact Bootstrapped Idris2
uses: actions/upload-artifact@v2
with:
name: macos-installed-bootstrapped-idris2-chez
path: ~/.idris2/
windows-bootstrap-chez:
needs: quick-check
runs-on: windows-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: windows]')
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
|| contains(needs.initialise.outputs.commit_message, '[ci: racket]')
env:
MSYSTEM: MINGW64
MSYS2_PATH_TYPE: inherit
SCHEME: scheme
CC: gcc
steps:
- name: Init
run: |
git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v2
- name: Get Chez Scheme
run: |
git clone --depth 1 https://github.com/cisco/ChezScheme
c:\msys64\usr\bin\bash -l -c "pacman -S --noconfirm tar make mingw-w64-x86_64-gcc"
echo "PWD=$(c:\msys64\usr\bin\cygpath -u $(pwd))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Configure and Build Chez Scheme
run: |
c:\msys64\usr\bin\bash -l -c "cd $env:PWD && cd ChezScheme && ./configure --threads && make"
- name: Set Path
run: |
$chez="$(pwd)\ChezScheme\ta6nt\bin\ta6nt"
$idris="$(pwd)\.idris2"
echo "$chez" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$idris\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "IDRIS_PREFIX=$idris" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PREFIX=$(c:\msys64\usr\bin\cygpath -u $idris)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Test Scheme
run: |
scheme --version
- name: Bootstrap
run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make bootstrap"
- name: Bootstrap test
run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make bootstrap-test"
- name: Install
run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make install"
- name: Artifact Idris2 from chez
uses: actions/upload-artifact@v2
with:
name: windows-installed-bootstrapped-idris2-chez
path: ${{ env.IDRIS_PREFIX }}
nix-bootstrap-chez:
needs: quick-check
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: nix]')
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v12
with:
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20210126_f15f0b8/install
- run: nix-build -A checks.x86_64-linux
# RACKET
ubuntu-bootstrap-racket:
needs: quick-check
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
|| contains(needs.initialise.outputs.commit_message, '[ci: racket]')
env:
IDRIS2_CG: racket
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt-get install -y racket
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
- name: Make bootstrap folder readonly
run: chmod -R a-w bootstrap
- name: Build from bootstrap
run: make bootstrap-racket && make install
- name: Artifact Bootstrapped Idris2
uses: actions/upload-artifact@v2
with:
name: ubuntu-installed-bootstrapped-idris2-racket
path: ~/.idris2/
######################################################################
# Self-hosting builds and testing
######################################################################
# CHEZ
ubuntu-self-host-chez:
needs: ubuntu-bootstrap-chez
runs-on: ubuntu-latest
env:
IDRIS2_CG: chez
SCHEME: scheme
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: ubuntu-installed-bootstrapped-idris2-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build self-hosted
run: make all IDRIS2_BOOT="idris2 -Werror" && make install
- name: Test self-hosted
run: make test INTERACTIVE=''
macos-self-host-chez:
needs: macos-bootstrap-chez
runs-on: macos-latest
env:
SCHEME: chez
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: macos-installed-bootstrapped-idris2-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
brew install chezscheme
brew install coreutils
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build self-hosted
run: make all IDRIS2_BOOT="idris2 -Werror" && make install
shell: bash
- name: Test self-hosted
run: make test INTERACTIVE=''
shell: bash
# RACKET
ubuntu-self-host-racket:
needs: ubuntu-bootstrap-racket
runs-on: ubuntu-latest
if: false
env:
IDRIS2_CG: racket
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: ubuntu-installed-bootstrapped-idris2-racket
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get install -y racket
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build self-hosted
run: make all IDRIS2_BOOT="idris2 -Werror" && make install
- name: Test self-hosted
run: make test INTERACTIVE=''
ubuntu-self-host-previous-version:
needs: quick-check
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
2021-07-27 10:58:40 +03:00
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: ubuntu-installed-idris2-${{ env.IDRIS2_VERSION }}-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build self-hosted from previous version
run: make all IDRIS2_BOOT="idris2 -Werror" && make install
- name: Test self-hosted from previous version
run: make test INTERACTIVE=''
- name: Artifact Idris2
uses: actions/upload-artifact@v2
with:
2021-02-04 21:41:47 +03:00
name: idris2-nightly-chez
path: ~/.idris2/
windows-self-host-racket:
needs: windows-bootstrap-chez
runs-on: windows-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: windows]')
|| contains(needs.initialise.outputs.commit_message, '[ci: racket]')
env:
IDRIS2_CG: racket
MSYSTEM: MINGW64
MSYS2_PATH_TYPE: inherit
CC: gcc
RACKET_RACO: raco
steps:
- name: Init
run: |
git config --global core.autocrlf false
echo "PWD=$(c:\msys64\usr\bin\cygpath -u $(pwd))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Checkout
uses: actions/checkout@v2
- name: Get Chez Scheme
run: |
git clone --depth 1 https://github.com/cisco/ChezScheme
c:\msys64\usr\bin\bash -l -c "pacman -S --noconfirm tar make mingw-w64-x86_64-gcc"
echo "PWD=$(c:\msys64\usr\bin\cygpath -u $(pwd))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Configure and Build Chez Scheme
run: |
c:\msys64\usr\bin\bash -l -c "cd $env:PWD && cd ChezScheme && ./configure --threads && make"
- name: Set Path
run: |
$chez="$(pwd)\ChezScheme\ta6nt\bin\ta6nt"
$idris="$(pwd)\.idris2"
echo "$chez" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$idris\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "IDRIS_PREFIX=$idris" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PREFIX=$(c:\msys64\usr\bin\cygpath -u $idris)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: windows-installed-bootstrapped-idris2-chez
path: ${{ env.IDRIS_PREFIX }}
- name: Install build dependencies
uses: Bogdanp/setup-racket@v1.4
with:
variant: 'CS'
version: 'stable'
distribution: 'full'
- name: Self host
run: |
c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make"
# TODO: fix the broken tests!
# - name: Test
# run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make test"
- name: Install
run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make install"
######################################################################
# Ubuntu API
######################################################################
ubuntu-build-api:
needs: ubuntu-bootstrap-chez
runs-on: ubuntu-latest
env:
IDRIS2_CG: chez
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: ubuntu-installed-bootstrapped-idris2-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build API
run: make install-api
shell: bash
- name: Test API
run: cd tests/idris2/api001 && ./run idris2
shell: bash
2021-07-27 10:58:40 +03:00
######################################################################
# Ubuntu testing some libraries.
# We are particularly interested in libraries that are heavily using
# dependent types, that are prone to find bugs and regressions in the
# compiler.
######################################################################
ubuntu-test-collie:
needs: ubuntu-self-host-previous-version
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: idris2-nightly-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
2021-07-27 10:58:40 +03:00
- name: Checkout
uses: actions/checkout@v2
with:
repository: 'ohad/collie'
- name: Build Collie
run: |
make
ubuntu-test-frex:
needs: ubuntu-self-host-previous-version
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: idris2-nightly-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
2021-07-27 10:58:40 +03:00
- name: Checkout
uses: actions/checkout@v2
with:
repository: 'frex-project/idris-frex'
- name: Build Frex
run: |
make
Experimental Scheme based evaluator (#1956) This is for compiled evaluation at compile-time, for full normalisation. You can try it by setting the evaluation mode to scheme (that is, :set eval scheme at the REPL). It's certainly an order of magnitude faster than the standard evaluator, based on my playing around with it, although still quite a bit slower than compilation for various reasons, including: * It has to evaluate under binders, and therefore deal with blocked symbols * It has to maintain enough information to be able to read back a Term from the evaluated scheme object, which means retaining things like types and other metadata * We can't do a lot of the optimisations we'd do for runtime evaluation particularly setting things up so we don't need to do arity checking Also added a new option evaltiming (set with :set evaltiming) to display how long evaluation itself takes, which is handy for checking performance. I also don't think we should aim to replace the standard evaluator, in general, at least not for a while, because that will involve rewriting a lot of things and working out how to make it work as Call By Name (which is clearly possible, but fiddly). Still, it's going to be interesting to experiment with it! I think it will be a good idea to use it for elaborator reflection and type providers when we eventually get around to implementing them. Original commit details: * Add ability to evaluate open terms via Scheme Still lots of polish and more formal testing to do here before we can use it in practice, but you can still use ':scheme <term>' at the REPL to evaluate an expression by compiling to scheme then reading back the result. Also added 'evaltiming' option at the REPL, which, when set, displays how long normalisaton takes (doesn't count resugaring, just the normalisation step). * Add scheme evaluation mode Different when evaluating everything, vs only evaluating visible things. We want the latter when type checking, the former at the REPL. * Bring support.rkt up to date A couple of missing things required for interfacing with scheme objects * More Scheme readback machinery We need these things in the next version so that the next-but-one version can have a scheme evaluator! * Add top level interface to scheme based normaliser Also check it's available - currently chez only - and revert to the default slow normaliser if it's not. * Bring Context up to date with changes in main * Now need Idris 0.5.0 to build * Add SNF type for scheme values This will allow us to incrementally evaluate under lambdas, which will be useful for elaborator reflection and type providers. * Add Quote for scheme evaluator So, we can now get a weak head normal form, and evaluate the scope of a binder when we have an argument to plug in, or just quote back the whole thing. * Add new 'scheme' evaluator mode at the REPL Replacing the temporary 'TmpScheme', this is a better way to try out the scheme based evaluator * Fix name generation for new UN format * Add scheme evaluator support to Racket * Add another scheme eval test With metavariables this time * evaltiming now times execution too This was handy for finding out the difference between the scheme based evaluator and compilation. Compilation was something like 20 times faster in my little test, so that'd be about 4-500 times faster than the standard evaluator. Ouch! * Fix whitespace errors * Error handling when trying to evaluate Scheme
2021-09-24 22:38:55 +03:00
make test
ubuntu-test-elab:
needs: ubuntu-self-host-previous-version
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: idris2-nightly-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Checkout
uses: actions/checkout@v2
with:
repository: 'stefan-hoeck/idris2-elab-util'
- name: Build idris2-elab-util
run: |
make all
######################################################################
# Ubuntu using katla to build html doc of the libs
######################################################################
ubuntu-katla:
needs: ubuntu-test-collie
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: html]')
env:
IDRIS2_CG: chez
steps:
- name: Initialise DEPLOY variable
run: |
if [[ '${{ github.ref }}' == 'refs/heads/main' ]]; then
echo "IDRIS2_DEPLOY=true" >> "$GITHUB_ENV"
fi
- name: Download Idris2 Artifact
uses: actions/download-artifact@v2
with:
name: idris2-nightly-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme markdown
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Checkout idris2
uses: actions/checkout@v2
- name: Build API
run: make install-api
shell: bash
- name: Checkout collie
uses: actions/checkout@v2
with:
repository: 'ohad/collie'
- name: Build and install Collie
run: |
make install
- name: Checkout idrall
uses: actions/checkout@v2
with:
repository: 'alexhumphreys/idrall'
- name: Build and install idrall
run: |
make install
- name: Checkout katla
uses: actions/checkout@v2
with:
repository: 'idris-community/katla'
- name: Build and install katla
run: |
make
mkdir -p "${HOME}"/.local/bin/
cp -r build/exec/* "${HOME}"/.local/bin/
echo "${HOME}/.local/bin" >> "$GITHUB_PATH"
- name: Checkout idris2
uses: actions/checkout@v2
- name: Build html doc & landing page
run: |
make -C libs/prelude/ install docs IDRIS2=idris2
make -C libs/base/ install docs IDRIS2=idris2
make -C libs/contrib/ install docs IDRIS2=idris2
make -C libs/network/ install docs IDRIS2=idris2
make -C libs/linear/ install docs IDRIS2=idris2
make -C libs/test/ install docs IDRIS2=idris2
make -C libs/papers/ install docs IDRIS2=idris2
cd .github/scripts
./katla.sh
cd -
cd www/
./katla.sh
cd -
cp -r www/html/* .github/scripts/html/
- name: Deploy HTML
uses: JamesIves/github-pages-deploy-action@4.1.3
if: ${{ success() && env.IDRIS2_DEPLOY }}
with:
branch: gh-pages
folder: .github/scripts/html/
git-config-name: Github Actions