name: Test blackout notifier

on:
  push:
    paths-ignore:
      - state/outages.json
  pull_request:
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    container:
      image: mahgit.ir/meghdadfadaee/daily-blackout-check-runner:latest
      credentials:
        username: ${{ secrets.REGISTRY_USERNAME }}
        password: ${{ secrets.REGISTRY_TOKEN }}
    env:
      PYTHONPATH: src
    steps:
      - name: Check out repository
        uses: https://gitea.com/actions/checkout@v4

      - name: Test standalone Bash CLI
        run: |
          bash -n main.sh tests/test_main.sh
          bash tests/test_main.sh

      - name: Lint
        run: ruff check .

      - name: Check formatting
        run: ruff format --check .

      - name: Test
        run: pytest
