mailApp/.drone.yml

42 lines
1.2 KiB
YAML
Raw Normal View History

2021-11-05 14:17:36 +10:00
kind: pipeline
type: docker
name: mailApp
trigger:
branch:
- master
event:
- push
steps:
- name: postgresDBTest # Test that the service is ready to be acted upon for cargo tests
image: postgres:12-alpine
2021-11-08 13:04:51 +10:00
environment:
PGPASSWORD: password
commands:
2021-11-08 13:01:20 +10:00
- sleep 20
- "psql -U postgtres -d newsletter -h postgres"
- name: sqlxMigrate
2021-11-05 14:17:36 +10:00
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
2021-11-08 13:01:20 +10:00
image: postgres:12-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: newsletter
DATABASE_URL: postgres://postgres:password@postgres:5432/newsletter