-
Notifications
You must be signed in to change notification settings - Fork 19
66 lines (63 loc) · 2.22 KB
/
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
60
61
62
63
64
65
66
name: test
on:
push:
branches: [master, canary]
pull_request:
branches: [master, canary]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
env:
MYSQL_DB_DATABASE: keyv_test
MYSQL_DB_USER: root
MYSQL_DB_PASSWORD: root
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Start Redis
uses: supercharge/[email protected]
# - name: Start PostgreSQL
# uses: harmon758/postgresql-action@v1
# with:
# postgresql version: '11'
# postgresql password: postgres
# postgresql user: postgres
# postgresql db: keyv_test
- name: Start MongoDB
uses: supercharge/[email protected]
- name: Start MySQL
run: |
sudo systemctl start mysql.service
mysql -e 'CREATE DATABASE ${{ env.MYSQL_DB_DATABASE }}' -u${{ env.MYSQL_DB_USER }} -p${{ env.MYSQL_DB_PASSWORD }}
mysql -e 'SET GLOBAL max_connections = 300;' -u${{ env.MYSQL_DB_USER }} -p${{ env.MYSQL_DB_PASSWORD }}
- name: Start PostgreSQL on Ubuntu
run: |
sudo systemctl start postgresql.service
pg_isready
- name: Setup PostgreSQL for ava tests
run: |
sudo -u postgres psql --command="alter system set max_connections = 300;"
sudo -u postgres psql --command="CREATE DATABASE keyv_test;"
sudo -u postgres psql --command="ALTER ROLE postgres WITH PASSWORD 'postgres';" --command="\du"
sudo systemctl restart postgresql.service
pg_isready
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: latest
run_install: true
- run: pnpm test
- name: Report
run: npx c8 report --reporter=text-lcov > coverage/lcov.info
- name: Coverage
uses: coverallsapp/github-action@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}