Skip to content

Build and test

Build and test #256

Workflow file for this run

---
name: Build and test
on:
push:
branches:
- main
- master
tags:
- '**'
pull_request:
branches:
- main
- master
schedule:
- cron: '0 1 * * *'
concurrency:
group: ${{ github.workflow }}@${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
PACK_DIR: /root/.pack
jobs:
build-and-test:
name: Build and test `${{ github.repository }}`
runs-on: ubuntu-latest
container: ghcr.io/stefan-hoeck/idris2-pack:latest
strategy:
fail-fast: false
matrix:
upstream-mode: [latest-pack-collection, bleeding-edge-compiler]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update `pack-db`
run: pack update-db
- name: Switch to the latest compiler, if needed
if: ${{ matrix.upstream-mode == 'bleeding-edge-compiler' }}
run: |
{ echo; echo "[idris2]"; echo 'commit = "latest:main"'; } >> pack.toml
pack fetch
- name: Switch to the latest collection
run: pack switch latest
- name: Compute the package name
run: echo "package_name=$(sed -e 's|.*/||' -e 's/idris2\?-//' <<< ${{ github.repository }})" >> "$GITHUB_ENV"
- name: Build `${{ env.package_name }}`
run: pack build ${{ env.package_name }}
- name: Test `${{ env.package_name }}`
run: pack test ${{ env.package_name }}