-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (49 loc) · 1.64 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
name: ci
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
env:
NODE_VERSION: 20
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }}
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }}
FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
service: [frontend, backend/question-service, backend/user-service]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setting node version
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
working-directory: ${{ matrix.service }}
run: npm install
- name: Linting
working-directory: ${{ matrix.service }}
run: npm run lint
- name: Set .env variables
working-directory: ${{ matrix.service }}
run: |
touch .env
echo "FIREBASE_PROJECT_ID=${{ env.FIREBASE_PROJECT_ID }}" >> .env
echo "FIREBASE_PRIVATE_KEY=${{ env.FIREBASE_PRIVATE_KEY }}" >> .env
echo "FIREBASE_CLIENT_EMAIL=${{ env.FIREBASE_CLIENT_EMAIL }}" >> .env
echo "FIREBASE_CLIENT_EMAIL=${{ env.FIREBASE_CLIENT_EMAIL }}" >> .env
echo "FIREBASE_STORAGE_BUCKET=${{ env.FIREBASE_STORAGE_BUCKET }}" >> .env
- name: Debug
working-directory: ${{ matrix.service }}
run: |
echo "FIREBASE_PROJECT_ID=${{ env.FIREBASE_PROJECT_ID }}"
- name: Tests
working-directory: ${{ matrix.service }}
run: npm test