mirror of
https://codeberg.org/demostf/api-client.git
synced 2026-06-03 08:34:15 +02:00
66 lines
No EOL
1.5 KiB
YAML
66 lines
No EOL
1.5 KiB
YAML
on: [push, pull_request]
|
|
|
|
name: CI
|
|
|
|
jobs:
|
|
check:
|
|
name: Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: check
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
name: Tests
|
|
|
|
services:
|
|
api-test-db:
|
|
image: demostf/db
|
|
env:
|
|
POSTGRES_PASSWORD: test
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
api:
|
|
image: demostf/api
|
|
env:
|
|
DEMO_ROOT: /tmp
|
|
DEMO_HOST: localhost
|
|
DB_TYPE: pgsql
|
|
DB_HOST: api-test-db
|
|
DB_PORT: 5432
|
|
DB_DATABASE: postgres
|
|
DB_USERNAME: postgres
|
|
DB_PASSWORD: test
|
|
APP_ROOT: https://api.localhost
|
|
EDIT_SECRET: edit
|
|
api-test:
|
|
image: demostf/api-nginx-test
|
|
env:
|
|
POSTGRES_PASSWORD: test
|
|
ports:
|
|
- 80:80
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
- uses: actions-rs/cargo@v1
|
|
env:
|
|
DB_URL: postgres://postgres:test@localhost/postgres
|
|
API_ROOT: http://localhost/
|
|
with:
|
|
command: test
|
|
args: -- --test-threads 1
|
|
- name: logs
|
|
uses: jwalton/gh-docker-logs@v1
|
|
if: failure() |