-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (49 loc) · 1.42 KB
/
test.yml
File metadata and controls
50 lines (49 loc) · 1.42 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
name: Tests
'on':
push:
branches:
- main
jobs:
test:
name: 'Test TypeSpeed'
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
rabbitmq:
image: rabbitmq:3.8
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672
steps:
- uses: actions/setup-node@v1
with:
node-version: 16
- uses: actions/checkout@v2
- name: Setup MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE test;USE test; \
CREATE TABLE `user` (`id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(100) DEFAULT NULL,PRIMARY KEY (`id`)) \
ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;SHOW TABLES;' -uroot -proot
- name: 'Cache node_modules'
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-v18-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-v18-
- name: Install Dependencies
run: npm install
- name: Run Tests with Coverage
run: npm run test-with-coverage
env:
LOCAL_HOST: localhost
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}