Fix disconnect #112
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
DATABASE_URL: sqlite:${{ github.workspace }}/healthpi.db | |
RUSTFLAGS: "-Dwarnings" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
id: toolchain | |
uses: dtolnay/[email protected] | |
with: | |
components: clippy, rustfmt | |
- name: Install dependencies | |
run: sudo apt install libdbus-1-dev pkg-config && cargo install sqlx-cli | |
- name: Run migration | |
run: sqlx database create && sqlx migrate run | |
- name: Check formatting | |
run: cargo fmt --check | |
- name: Cache cargo dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-rust-${{ steps.toolchain.outputs.cachekey }} | |
- name: Run clippy | |
run: cargo clippy | |
- name: Run tests | |
run: cargo test |