-
Notifications
You must be signed in to change notification settings - Fork 43
42 lines (35 loc) · 1.15 KB
/
ci-run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Run tests
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Docker build app-test
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
target: app-test
push: false
tags: app-test:latest
- name: Start database
run: docker run --name=database -e POSTGRES_DB=app -e POSTGRES_PASSWORD=password -d postgres:14.6
- name: Start memcached
run: docker run --name=memcached -d memcached:latest
- name: Run tests
run: |
set -x
docker run -i --rm --name=app-test -u root --link=database --link=memcached -e DATABASE_URL="postgres://postgres:password@database/app" -e APP_SECRET_KEY=xxxx -e ENVIRONMENT=test -v $(pwd)/coverage:/coverage app-test
cp coverage/.coverage coverage/coverage.xml ./
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}