name: Rust Flag Engine Pull Request

on:
    pull_request:
        types: [opened, synchronize, reopened, ready_for_review]
        branches:
            - main
            - release**

env:
  CARGO_TERM_COLOR: always

jobs:
  test:

    runs-on: ubuntu-latest

    steps:
    - name: Cloning repo
      uses: actions/checkout@v2
      with:
        fetch-depth: 0
        submodules: recursive
    - uses: actions/checkout@v2
    - name: Build
      run: cargo build --verbose
    - name: Run tests
      run: cargo test --verbose
    - name: Check Formatting
      run: cargo fmt --all -- --check
