test: run database tests in CI #361
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test, lint and check TS | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
jobs: | |
test: | |
services: | |
sql: | |
image: mcr.microsoft.com/mssql/server:2019-latest | |
env: | |
SA_PASSWORD: Passw0rd! | |
ACCEPT_EULA: Y | |
ports: | |
- "1433:1433" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Create db | |
run: | | |
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Passw0rd! -Q "CREATE DATABASE [tenants-leases-test]" | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test:ci | |
- name: Run linting | |
run: npm run lint | |
- name: Check TS | |
run: npm run ts:ci |