name: Continuous Integration

on: [push, pull_request, workflow_dispatch]

jobs:
  build:
    name: Build and check formatting
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Execute all tests
      run: ./tests/ci.sh

  links:
    name: Check links
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Link Checker
      uses: peter-evans/link-checker@v1
      with:
        args: -v -r *.md
    - name: Fail if there were link errors
      run: exit ${{ steps.lc.outputs.exit_code }}
