name: Build

on:
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: codeberg-medium-lazy
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - run: |
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

      - name: Run clippy
        run: |
          $HOME/.cargo/bin/cargo clippy -- -Dwarnings

      - name: Build
        run: |
          $HOME/.cargo/bin/cargo build
          $HOME/.cargo/bin/cargo test
