-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (104 loc) · 3.15 KB
/
github-actions.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
name: Frontend/Backend pipeline
run-name: Frontend/Backend pipeline
on: [push]
jobs:
# fe-pipeline:
# name: Frontend Pipeline
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./frontend/core
# steps:
# - uses: actions/checkout@v4
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '20.x'
# - name: Cache node_modules
# id: cache-npm
# uses: actions/cache@v3
# env:
# cache-name: cache-fe-node-modules
# with:
# # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
# name: List the state of node modules
# continue-on-error: true
# run: npm list
# - name: Install dependencies
# run: npm install
# - name: Lint
# run: npm run lint
# - name: Compile
# run: npm run tsc
# - name: Test
# run: npm run test
# - name: Build
# run: npm run build
be-pipeline:
name: Backend Pipeline
runs-on: ubuntu-latest
# services:
# mysql:
# image: mysql:8.0
# env:
# MYSQL_DATABASE: test_todo
# MYSQL_ROOT_PASSWORD: root
# ports:
# - 3306:3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
AUTH_SECRET: testsecret
AUTH_SUGAR: testsugar
DATABASE_PASSWORD: root
defaults:
run:
working-directory: ./api
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Cache node_modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-be-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: MySQL
run: which mysql
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Compile
run: npm run tsc
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: E2E Test - Start Database Service
run: sudo systemctl start mysql.service
- name: E2E Test - Setup Database & Run
run: |
npm run db:test:create
npm run db:test:setup
npm run test:e2e