name: Rust

on: [push, pull_request]

env:
  CARGO_TERM_COLOR: always
  DATABASE_URL: "sqlite://./dim_dev.db"

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
        - run: sudo apt-get update
        - run: sudo apt-get install -y libva-dev libva-drm2 libva2 sqlite3
        - uses: actions/checkout@v2
        - uses: actions-rs/toolchain@v1
          with:
              profile: minimal
              toolchain: nightly
              override: true
              components: cargo
        - run: sqlite3 ./dim_dev.db -init ./database/migrations/20210619211347_dim.sql
        - uses: actions-rs/cargo@v1
          with:
              command: build
              args: --verbose --release
