This repository has been archived by the owner on Dec 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (85 loc) · 2.66 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
95
96
97
98
99
100
101
102
103
name: Continuous Integration Workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: 'Run Tests'
runs-on: ubuntu-latest
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
RENDER_API_TOKEN: ${{ secrets.RENDER_API_TOKEN }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
MONGO_URL_PROD: ${{ secrets.MONGO_URL_PROD }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
REFRESH_TOKEN_SECRET: ${{ secrets.REFRESH_TOKEN_SECRET }}
TEST_DB: ${{ secrets.TEST_DB }}
VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }}
VITE_APP_EMAIL: ${{ secrets.VITE_APP_EMAIL }}
VITE_APP_PASSWORD: ${{ secrets.VITE_APP_PASSWORD }}
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v2
- name: 'Install Node.js'
uses: actions/setup-node@v3
with:
node-version: 20.11.1
- name: 'Install Dependencies & Test Frontend'
working-directory: ./client
run: |
npm install
npm test
- name: 'Install Dependencies & Test Backend'
working-directory: ./server
run: |
npm install
npm test
- name: 'Install wait-on'
run: npm install -g wait-on
- name: 'Start Backend'
run: |
cd ./server
npm start > server.log 2>&1 &
echo "Started backend"
- name: 'Start Frontend'
run: |
cd ./client
npm run dev > frontend.log 2>&1 &
echo "Started frontend"
- name: 'Debug Environment Variables'
run: |
echo "VITE_APP_EMAIL=$VITE_APP_EMAIL"
echo "VITE_APP_PASSWORD=$VITE_APP_PASSWORD"
- name: 'Run End-to-End Tests'
working-directory: ./client
run: |
npx cypress run
lint:
name: 'Run linter & Prettier'
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v2
- name: 'Install Node.js'
uses: actions/setup-node@v3
with:
node-version: 20.11.1
- name: 'Install Frontend Dependencies & Run Linter & Prettier'
working-directory: ./client
run: |
npm install
npm run lint:fix
npm run format
- name: 'Install Backend Dependencies & Run Prettier Format'
working-directory: ./server
run: |
npm install
npm run format