7d7e7dc2d5
enable postgres DB on drone pipeline for further tests
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: mailApp
|
|
|
|
trigger:
|
|
branch:
|
|
- master
|
|
event:
|
|
- push
|
|
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_DB: newsletter
|
|
DATABASE_URL: postgres://postgres:password@postgres:5432/newsletter
|
|
|
|
steps:
|
|
- name: postgresDBTest # Test that the service is ready to be acted upon for cargo tests
|
|
image: postgres:12-alpine
|
|
commands:
|
|
- sleep 15
|
|
- psql -U ${POSTGRES_USER} -d ${POSTGRES_DB}
|
|
|
|
- name: sqlxMigrate
|
|
image: rust:1.56
|
|
commands:
|
|
- apt update && apt install -y build-essential pkg-config libssl-dev # Dependancies for sqlx
|
|
- cargo install --version=0.5.7 sqlx-cli --no-default-features --features postgres # Install sqlx
|
|
- sqlx database create
|
|
- sqlx migrate run
|
|
|
|
- name: test
|
|
image: rust:1.56
|
|
commands:
|
|
- apt update && apt install -y build-essential pkg-config libssl-dev # Dependancies for tarpaulin
|
|
- cargo install cargo-tarpaulin
|
|
- cargo tarpaulin -v --all-features --timeout 120 --color always # RUN THOSE TESTS
|
|
|
|
services:
|
|
- name: postgres
|
|
image: postgres:12-alpine |