name: CI

on:
  workflow_dispatch:
  pull_request:

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      id-token: write
    steps:
      - name: Download actionlint
        run: |
          mkdir -p "$HOME/bin"
          bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) latest "$HOME/bin"
          echo "${HOME}/bin" >> "$GITHUB_PATH"
      - uses: open-turo/actions-node/lint@v7
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: open-turo/actions-node/test@v7
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          test-flags: --coverage
