32 lines
627 B
YAML
32 lines
627 B
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
SQLX_VERSION: 0.7.1
|
|
SQLX_FEATURES: "rustls,postgres"
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres:15
|
|
ports:
|
|
- 5432:5432
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Migrate database
|
|
run: |
|
|
sudo apt-get install libpq-dev -y
|
|
cargo install sqlx-cli --no-default-features --features postgres
|
|
./scripts/init_db.sh
|
|
- name: Run tests
|
|
run: cargo test
|