-
Notifications
You must be signed in to change notification settings - Fork 6
59 lines (59 loc) · 2.08 KB
/
unit-test.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
name: Unit tests
on:
push: {}
workflow_call: {}
jobs:
build:
runs-on: ubuntu-latest
services:
s3:
image: adobe/s3mock
env:
"initialBuckets": "bucket"
ports:
- "9090:9090"
mongodb:
image: mongo:5
env:
"MONGO_INITDB_ROOT_USERNAME": "root"
"MONGO_INITDB_ROOT_PASSWORD": "password"
ports:
- 27017:27017
postgres:
image: postgres:14-alpine
env:
"POSTGRES_PASSWORD": "password"
"POSTGRES_USER": "root"
"POSTGRES_DB": "main_db"
ports:
- "27016:5432"
mysql:
image: mysql:8.0
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
# We need to use this long command in order to execute the last part : mysql_native_password
# https://stackoverflow.com/questions/60902904/how-to-pass-mysql-native-password-to-mysql-service-in-github-actions
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=mypassword -e MYSQL_DATABASE=catsdb --entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
ports:
- "27015:3306"
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Add local.aikido.io to /etc/hosts
run: |
sudo echo "127.0.0.1 local.aikido.io" | sudo tee -a /etc/hosts
- run: make install
- run: make test-ci
- name: "Upload coverage"
uses: codecov/[email protected]
with:
file: ./library/.tap/report/lcov.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
slug: AikidoSec/firewall-node