Build and test #166
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 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- 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 }} |