name: Nightly Canary

on:
  schedule:
    - cron: '0 6 * * *'  # daily at 06:00 UTC
  workflow_dispatch:

jobs:
  canary:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          profile: minimal

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --release

      - uses: actions-rs/cargo@v1
        with:
          command: test

      - name: Upload canary binary
        uses: actions/upload-artifact@v7
        with:
          name: react-auditor-canary-x86_64-linux
          path: target/release/react-auditor
