2021-11-05 14:17:36 +10:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: mailApp
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
steps:
|
2021-11-08 12:43:28 +10:00
|
|
|
- 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
|
2021-11-08 15:41:52 +10:00
|
|
|
DATABASE_URL: postgres://postgres:password@postgres:5432/newsletter
|
2021-11-08 12:43:28 +10:00
|
|
|
commands:
|
2021-11-08 13:06:02 +10:00
|
|
|
- sleep 35
|
2021-11-08 13:07:55 +10:00
|
|
|
- "psql -U postgres -d newsletter -h postgres"
|
2021-11-08 12:43:28 +10:00
|
|
|
|
|
|
|
- name: sqlxMigrate
|
2021-11-05 14:17:36 +10:00
|
|
|
image: rust:1.56
|
|
|
|
commands:
|
2021-11-08 12:43:28 +10:00
|
|
|
- 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 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
|
2021-11-08 15:41:52 +10:00
|
|
|
POSTGRES_DB: newsletter
|