Merge pull request #11 from WartaPoirier-corp/rocket-0.5 #84
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: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-server: | |
runs-on: ubuntu-latest | |
container: willsquire/diesel-cli | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DB: wartid | |
POSTGRES_USER: wartid | |
POSTGRES_PASSWORD: wartid | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Install psql | |
run: apt update && apt install -y postgresql-client | |
- name: Test DB, install uuid-ossp, and interrupt action if it doesn't work | |
run: psql postgres://wartid:wartid@postgres/wartid --command='create extension "uuid-ossp";' | |
- uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v1 | |
- name: Apply migrations | |
working-directory: ./wartid-server/ | |
run: diesel migration run | |
env: | |
DATABASE_URL: postgres://wartid:wartid@postgres/wartid | |
- name: Build --all-features | |
working-directory: ./wartid-server/ | |
run: cargo build --release --all-features --verbose | |
- name: Build --no-default-features | |
working-directory: ./wartid-server/ | |
run: cargo build --release --no-default-features --verbose | |
- name: Run tests | |
working-directory: ./wartid-server/ | |
run: cargo test --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wartid-server | |
path: ./target/release/wartid-server |