-
Notifications
You must be signed in to change notification settings - Fork 109
42 lines (42 loc) · 1.03 KB
/
tests.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
name: tests
env:
DB_USER: session_test
DB_PASS: session_test
DB_NAME: session_test
on:
push:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22]
services:
mysql:
image: mysql:5.7
ports:
- 3306
env:
MYSQL_DATABASE: ${{ env.DB_NAME }}
MYSQL_USER: ${{ env.DB_USER }}
MYSQL_PASSWORD: ${{ env.DB_PASS }}
MYSQL_RANDOM_ROOT_PASSWORD: 1
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Run Tests
env:
DB_HOST: localhost
DB_PORT: ${{ job.services.mysql.ports[3306] }}
run: npm run test