You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

71 lines
2.1 KiB

name: test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CI: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
# 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:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.2.0
with:
redis-version: 6
# - 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/mongodb-github-action@1.6.0
with:
mongodb-version: 4.4
- name: Start MySQL
run: |
sudo /etc/init.d/mysql start
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
- run: npm install --no-package-lock
- run: npm test
- name: Coverage
run: npm run coverage
- name: Upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}