-
Notifications
You must be signed in to change notification settings - Fork 8
89 lines (72 loc) · 2.35 KB
/
Copy pathci.yaml
File metadata and controls
89 lines (72 loc) · 2.35 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Continuous Integration
on:
push:
paths-ignore:
- '**.md' # Ignore changes to markdown files
branches-ignore:
- 'master' # We have a separate workflow for master branch
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
NODE_ENV: test
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Up Node.js Environment
uses: actions/setup-node@v3
with:
node-version: 20.18.0
cache: 'yarn' # Cache Yarn dependencies
- name: Install Dependencies
run: yarn install --frozen-lockfile # Ensures dependencies match yarn.lock
- name: Run Code Linting
run: yarn lint
- name: Execute Unit Tests
run: yarn test:coverage
- name: Merge Coverage Reports
run: yarn merge-coverage
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' # Run only on develop and master
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' # Run only on develop and master
e2e-test:
name: End To End Test
runs-on: ubuntu-latest
env:
NODE_ENV: ci
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_PASSWORD: mysql
MYSQL_USER: mysql
MYSQL_DATABASE: conduit
ports:
- 3306:3306
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Up Node.js Environment
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn' # Cache Yarn dependencies
- name: Install Dependencies
run: yarn install --frozen-lockfile # Ensures dependencies match yarn.lock
- name: Run Database Migration
run: yarn db:migrate
- name: Build Application
run: yarn build
- name: Start Server in the Background
run: yarn start:ci --filter=@conduit/local
- name: Wait for the Server to Start
run: ./scripts/wait-for-readiness.sh
- name: Install Newman
run: npm install -g newman
- name: Run Integration Test
run: ./scripts/api-test.sh