mirror of
https://codeberg.org/demostf/api-client.git
synced 2026-06-04 00:54:11 +02:00
add github actions ci
This commit is contained in:
parent
16637e31f5
commit
59c9efe395
4 changed files with 73 additions and 39 deletions
66
.github/workflows/rust.yml
vendored
Normal file
66
.github/workflows/rust.yml
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue