name: test
on:
  push:
    branches:
      - main
  pull_request:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: raviqqe/cargo-cache@v1
      - run: cargo build
  unit_test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: raviqqe/cargo-cache@v1
      - run: cargo test
  test:
    needs:
      - build
      - unit_test
    if: always()
    runs-on: ubuntu-latest
    steps:
      - run: for result in ${{ join(needs.*.result, ' ') }}; do [ $result = success ]; done
