-
Notifications
You must be signed in to change notification settings - Fork 4
94 lines (88 loc) · 2.39 KB
/
ci.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
name: CI
on:
push:
branches:
- main
- testing-environment
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: yarn install
- run: yarn build
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: yarn install
- run: yarn format:check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: yarn install
- run: yarn lint
lint-docker:
name: Lint (Dockerfile)
container: hadolint/hadolint:latest-debian
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: hadolint Dockerfile
test:
name: Test
if: "false"
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.4
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
api:
image: ghcr.io/hack-as-a-service/api:main
ports:
- 5000:5000
env:
ROCKET_DATABASES: '{db = {url = "postgres://postgres:postgres@postgres:5432/postgres"}}'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up development database
run: "docker run --network host --rm -e 'DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres' ghcr.io/hack-as-a-service/migrator:main"
- name: Run Cypress E2E tests
uses: cypress-io/github-action@v2
with:
build: yarn build
start: yarn start
browser: chrome
config: defaultCommandTimeout=7000
env:
NO_PROXY: "false"
NEXT_PUBLIC_API_BASE: http://localhost:3000/api
- name: Run Cypress Component tests
uses: cypress-io/github-action@v2
with:
install: false
command: yarn cypress run-ct --browser=chrome --config defaultCommandTimeout=7000
env:
NO_PROXY: "false"
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
path: cypress/videos/*.mp4