Build and test #267
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 }} |