Skip to content

feat/v2

feat/v2 #41

Workflow file for this run

name: Build and Test
on:
pull_request:
branches:
- main
jobs:
build:
name: Run build with ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 20.x, 18.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
env:
CI: true
- name: Lint code
run: npm run lint
env:
CI: true
- name: Unit test
run: npm run test:unit
env:
CI: true
integration:
name: Run integration tests with ${{ matrix.database-type }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
database-type:
[
mysql90,
mysql84,
mysql80,
mysql57,
mariadb1104,
mariadb1011,
mariadb1006,
mariadb1005,
mariadb1004,
]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.x
- name: Install dependencies
run: npm ci
env:
CI: true
- name: Start Database(s)
run: |
docker compose \
--file ".devcontainer/docker-compose.yml" \
up \
--detach \
--build \
"${{ matrix.database-type }}"
- name: Initialize Database
run: |
docker compose \
--file ".devcontainer/docker-compose.yml" \
up \
"wait${{ matrix.database-type }}"
- name: Build and test
run: |
npm run test:integration
env:
CI: true
DB: ${{ matrix.database-type }}
- name: Stop Database(s)
run: |
docker compose \
--file ".devcontainer/docker-compose.yml" \
down