-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 2.01 KB
/
test.yaml
File metadata and controls
72 lines (60 loc) · 2.01 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# name: Build and test
# on: [workflow_dispatch, push]
# jobs:
# test:
# runs-on: ubuntu-latest
# env:
# DOCKER_BUILDKIT: 1
# COMPOSE_DOCKER_CLI_BUILD: 1
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Build backend
# id: docker_build_backend
# uses: docker/build-push-action@v2
# with:
# push: false
# tags: "fastapi_template-backend:latest"
# cache-from: type=gha
# cache-to: type=gha,mode=max
# context: backend
# load: true
# - name: Build frontend
# id: docker_build_frontend
# uses: docker/build-push-action@v2
# with:
# push: false
# tags: "fastapi_template-frontend:latest"
# cache-from: type=gha,scope=ci-test
# cache-to: type=gha,mode=max,scope=ci-test
# context: frontend
# load: true
# - name: Start containers and run tests
# run: |
# mv env-template .env
# docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d
# docker-compose exec -T postgres createdb -U postgres apptest
# - name: Check that models are in sync with alembic migrations
# run: |
# docker-compose exec -T backend alembic upgrade head
# docker-compose exec -T backend alembic check
# - name: Run tests
# run: |
# docker-compose exec -T backend pytest -v --cov --cov-report term-missing
# - name: Cypress run
# uses: cypress-io/github-action@v5
# env:
# # Add Cypress key to Github project settings if you want to
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# # Set to true to record
# record: false
# working-directory: frontend
# - name: Log docker status
# if: ${{ always() }}
# run: |
# docker-compose ps
# docker-compose logs -t