Skip to content

Test pack and lsp during CI #1

Test pack and lsp during CI

Test pack and lsp during CI #1

Workflow file for this run

name: Build External Libraries
######################################################################
# 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.
######################################################################
on:
push:
branches:
- '*'
tags:
- '*'
paths-ignore:
- 'docs/**'
- 'icons/**'
- 'Release/**'
- '**.md'
- 'CONTRIBUTORS'
- 'LICENSE'
- 'CHANGELOG.md'
- '.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'
concurrency:
group: extlibs-${{ github.ref }}
cancel-in-progress: true
env:
IDRIS2_MINIMUM_COMPAT_VERSION: 0.6.0
jobs:
# First 3 jobs blatantly stolen from ci-idris2
initialise:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
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 "commit_message=$(git log --format=%B -n 1 HEAD | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
elif [[ '${{ github.event_name }}' == 'pull_request' ]]; then
echo "commit_message=$(git log --format=%B -n 1 HEAD^2 | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
fi
outputs:
commit_message:
echo "${{ steps.get_commit_message.outputs.commit_message }}"
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@v3
- 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@v3
with:
path: Idris2-${{ env.IDRIS2_MINIMUM_COMPAT_VERSION }}
key: ${{ runner.os }}-idris2-bootstrapped-chez-${{ env.IDRIS2_MINIMUM_COMPAT_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_MINIMUM_COMPAT_VERSION.tgz"
tar zxvf "idris2-$IDRIS2_MINIMUM_COMPAT_VERSION.tgz"
cd "Idris2-$IDRIS2_MINIMUM_COMPAT_VERSION"
make bootstrap
cd ..
- name: Install previous version
run: |
cd "Idris2-$IDRIS2_MINIMUM_COMPAT_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@v3
with:
name: ubuntu-installed-idris2-${{ env.IDRIS2_MINIMUM_COMPAT_VERSION }}-chez
path: ~/.idris2/
ubuntu-self-host-previous-version:
needs: [initialise, 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: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Idris2 Artifact
uses: actions/download-artifact@v3
with:
name: ubuntu-installed-idris2-${{ env.IDRIS2_MINIMUM_COMPAT_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 ci-ubuntu-test INTERACTIVE=''
- name: Artifact Idris2
uses: actions/upload-artifact@v3
with:
name: idris2-nightly-chez
path: ~/.idris2/
########################################################################
# Test that we can build Collie
########################################################################
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@v3
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@v3
with:
repository: 'ohad/collie'
- name: Build Collie
run: |
make
########################################################################
# Test that we can build Frex
########################################################################
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@v3
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@v3
with:
repository: 'frex-project/idris-frex'
- name: Build Frex
run: |
make
make test
######################################################################
# Test that we can build Stefan Höck's elab-util and pack
######################################################################
# ELAB
test-elab-util:
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@v3
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@v3
with:
repository: 'stefan-hoeck/idris2-elab-util'
- name: Build idris2-elab-util
run: |
make all
# PACK
test-pack:
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
PACK_DIR: /root/.pack
strategy:
fail-fast: false
# instead of bootstrapping pack, load the dockerimage where it is already
# we'll then use pack to build pack with this job's idris2 sources
container: ghcr.io/stefan-hoeck/idris2-pack:latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: 'stefan-hoeck/idris2-pack'
# by default, pack uses the main idris2 head, not the current job's one
- name: Toml setup
run: |
echo "[idris2]" > pack.toml
echo "url = \"https://github.com/${GITHUB_REPOSITORY}\"" >> pack.toml
echo "commit = \"latest:${GITHUB_REF_NAME}\"" >> pack.toml
echo "bootstrap = true" >> pack.toml
- name: Build idris2-pack
run: |
git config --global --add safe.directory "${PWD}"
git fetch "https://github.com/${GITHUB_REPOSITORY}" "${GITHUB_REF}:${GITHUB_REF_NAME}"
pack install pack
######################################################################
# Test that we can build the LSP
######################################################################
test-lsp-pack:
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
PACK_DIR: /root/.pack
container: ghcr.io/stefan-hoeck/idris2-pack:latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: 'idris-community/idris2-lsp'
- name: Toml setup
run: |
echo "[idris2]" > pack.toml
echo "url = \"https://github.com/${GITHUB_REPOSITORY}\"" >> pack.toml
echo "commit = \"latest:${GITHUB_REF_NAME}\"" >> pack.toml
echo "bootstrap = true" >> pack.toml
- name: Build pack with PR-Idris
run: |
git config --global --add safe.directory "${PWD}"
git fetch "https://github.com/${GITHUB_REPOSITORY}" "${GITHUB_REF}:${GITHUB_REF_NAME}"
pack install pack
- name: Build+install idris2-lsp
run: |
pack --no-prompt install-app idris2-lsp
######################################################################
# Test that we can use Katla to build html doc of the libs
######################################################################
test-katla-and-html:
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: 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@v3
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@v3
- name: Build API
run: make install-api
shell: bash
- name: Checkout collie
uses: actions/checkout@v3
with:
repository: 'ohad/collie'
- name: Build and install Collie
run: |
make install
- name: Checkout idrall
uses: actions/checkout@v3
with:
repository: 'alexhumphreys/idrall'
- name: Build and install idrall
run: |
make install
- name: Checkout katla
uses: actions/checkout@v3
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@v3
- 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/[email protected]
if: ${{ success() && env.IDRIS2_DEPLOY }}
with:
branch: gh-pages
folder: .github/scripts/html/
git-config-name: Github Actions