-
Notifications
You must be signed in to change notification settings - Fork 3
123 lines (120 loc) · 3.66 KB
/
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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# name: Testing lcfs
# on: [push, workflow_dispatch]
# jobs:
# black:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.9'
# - name: Install deps
# uses: knowsuchagency/poetry-install@v1
# env:
# POETRY_VIRTUALENVS_CREATE: false
# - name: Run black check
# run: poetry run black --check .
# flake8:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.9'
# - name: Install deps
# uses: knowsuchagency/poetry-install@v1
# env:
# POETRY_VIRTUALENVS_CREATE: false
# - name: Run flake8 check
# run: poetry run flake8 --count .
# mypy:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.9'
# - name: Install deps
# uses: knowsuchagency/poetry-install@v1
# env:
# POETRY_VIRTUALENVS_CREATE: false
# - name: Run mypy check
# run: poetry run mypy .
# pytest:
# runs-on: ubuntu-latest
# services:
# lcfs-db:
# image: postgres:13.8-bullseye
# env:
# POSTGRES_PASSWORD: lcfs
# POSTGRES_USER: lcfs
# POSTGRES_DB: lcfs
# options: >-
# --health-cmd="pg_isready"
# --health-interval=10s
# --health-timeout=5s
# --health-retries=5
# ports:
# - 5432:5432
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.9'
# - name: Install deps
# uses: knowsuchagency/poetry-install@v1
# env:
# POETRY_VIRTUALENVS_CREATE: false
# - name: Run pytest check
# run: poetry run pytest -vv --cov="lcfs" .
# env:
# LCFS_HOST: "0.0.0.0"
# LCFS_DB_HOST: localhost
# cypress:
# runs-on: ubuntu-latest
# services:
# db:
# image: postgres:14.2
# env:
# POSTGRES_DB: lcfs
# POSTGRES_USER: lcfs
# POSTGRES_PASSWORD: development_only
# ports:
# - 5432:5432
# redis:
# image: bitnami/redis:6.2.5
# env:
# ALLOW_EMPTY_PASSWORD: "yes"
# ports:
# - 6379:6379
# steps:
# - uses: actions/checkout@v2
# - name: Build and Run Backend Service
# run: |
# docker build -t backend-service ./backend/Dockerfile
# docker run -d --name backend -e LCFS_DB_HOST=localhost -e LCFS_REDIS_HOST=localhost -p 8000:8000 backend-service
# - name: Data Seeding
# run: docker exec backend poetry run python /app/lcfs/db/seeders/seed_database.py
# - name: Build and Run Frontend Service
# run: |
# docker build -t frontend-service ./fontend/Dockerfile.dev
# docker run -d --name frontend -p 3000:3000 frontend-service
# - name: Cypress run
# uses: cypress-io/github-action@v2
# with:
# browser: chrome
# wait-on: 'http://localhost:3000'
# wait-on-timeout: 60
# env:
# CYPRESS_IDIR_TEST_USER: ${{ secrets.CYPRESS_IDIR_TEST_USER }}
# CYPRESS_IDIR_TEST_PASS: ${{ secrets.CYPRESS_IDIR_TEST_PASS }}
# CYPRESS_BCEID_TEST_USER: ${{ secrets.CYPRESS_BCEID_TEST_USER }}
# CYPRESS_BCEID_TEST_PASS: ${{ secrets.CYPRESS_BCEID_TEST_PASS }}
# - name: Cleanup
# run: |
# docker stop backend frontend
# docker rm backend frontend