Skip to content

Add automated release workflows #12

Add automated release workflows

Add automated release workflows #12

Workflow file for this run

name: Lint & Test
on: ['pull_request']
permissions:
contents: read
jobs:
commitlint:
name: Lint commits
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Lint commits
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
lintcode:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Lint code
run: npm run lint
test:
name: Run tests
runs-on: ubuntu-latest
env:
MSSQL_USER: 'sa'
MSSQL_PASSWORD: 'yourStrong(!)Password'
MSSQL_SERVER: 'localhost'
MSSQL_PORT: '1433'
MSSQL_DATABASE: 'master'
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
sql-version: [2017, 2019, 2022]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Run unit tests
run: npm run test-unit
- name: Start docker container
run: docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$MSSQL_PASSWORD" -p 1433:1433 -d mcr.microsoft.com/mssql/server:${{ matrix.sql-version }}-latest --name mssql
- name: Store test config
run: echo "{\"user\":\"$MSSQL_USER\",\"password\":\"$MSSQL_PASSWORD\",\"server\":\"$MSSQL_SERVER\",\"port\":$MSSQL_PORT,\"database\":\"$MSSQL_DATABASE\"}" > ./test/.mssql.json
- name: Run tedious tests
run: npm run test-tedious
- name: Stop container
if: ${{ always() }}
run: docker rm -f mssql