name: Rust

permissions:
  contents: read
  pull-requests: write

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
          - beta
          - nightly

    steps:
    - uses: actions/checkout@v3
    - name: Update
      run: cargo update
    - name: Build
      run: cargo build --release --verbose
    - name: Run tests
      run: cargo test --release --verbose
