name: Rust

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  check:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - run: cargo check
    - run: cargo clippy

  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - run: rustup update
    - run: cargo build --release
    - uses: actions/upload-artifact@v4
      with:
        path: target/release/shibe-bot
