permissions:
  contents: read

# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

on:
  push:
    branches: [main]
  pull_request:
  merge_group:
  schedule:
    - cron: "7 7 * * *"

name: rolling
jobs:
  # https://twitter.com/mycoliza/status/1571295690063753218
  nightly:
    runs-on: ubuntu-latest
    name: ubuntu / nightly
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: true
      - name: Install nightly
        uses: dtolnay/rust-toolchain@nightly
      - name: cargo generate-lockfile
        if: hashFiles('Cargo.lock') == ''
        run: cargo generate-lockfile
      - name: cargo test --locked
        run: cargo test --locked --all-features --all-targets
