Skip to content

Commit

Permalink
ci: reduce number of jobs we run
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Sep 3, 2023
1 parent e708274 commit 20b1992
Showing 1 changed file with 28 additions and 31 deletions.
59 changes: 28 additions & 31 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
jobs:
commitlint:
name: Lint commits
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -34,7 +34,7 @@ jobs:
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
codelint:
name: Lint code
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -50,11 +50,11 @@ jobs:
- name: Lint code
run: npm run lint
test-linux:
name: Run tests (linux)
runs-on: ubuntu-latest
name: Run tests
runs-on: ${{ matrix.os }}
services:
sqlserver:
image: mcr.microsoft.com/${{ matrix.sql-version == 'edge' && 'azure-sql-edge' || 'mssql/server' }}:${{ matrix.sql-version == 'edge' && 'latest' || format('{0}-latest', matrix.sql-version) }}
image: mcr.microsoft.com/${{ matrix.sqlserver == 'edge' && 'azure-sql-edge' || 'mssql/server' }}:${{ matrix.sqlserver == 'edge' && 'latest' || format('{0}-latest', matrix.sqlserver ) }}
ports:
- 1433:1433
env:
Expand All @@ -67,17 +67,18 @@ jobs:
MSSQL_PASSWORD: 'yourStrong(!)Password'
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
sql-version: [2017, 2019, 2022]
os: [ubuntu-22.04]
node: [14.x, 16.x, 18.x]
sqlserver: [2017, 2019, 2022]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }}
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm clean-install
Expand All @@ -102,11 +103,8 @@ jobs:
# run: npm install --no-save msnodesqlv8@^2
# - name: Run msnodesqlv8 tests
# run: npm run test-msnodesqlv8
- name: Stop container
if: ${{ always() }}
run: docker rm -f -v mssql
test-windows:
name: Run tests (win32)
name: Run tests
needs:
- commitlint
- codelint
Expand All @@ -116,27 +114,26 @@ jobs:
MSSQL_PASSWORD: 'yourStrong(!)Password'
strategy:
matrix:
arch: [x64, x86]
os: [windows-2022]
node-version: [14.x, 16.x, 18.x]
sql-version: [2016, 2017, 2019, 2022]
include:
- os: windows-2019
sql-version: 2008
- os: windows-2019
sql-version: 2012
- os: windows-2019
sql-version: 2014
os: [windows-2019, windows-2022]
node: [14.x, 16.x, 18.x]
sqlserver: [2008, 2012, 2014, 2016, 2017, 2019, 2022]
# These sqlserver versions don't work on windows-2022 (at the moment)
exclude:
- os: windows-2022
sqlserver: 2008
- os: windows-2022
sqlserver: 2012
- os: windows-2022
sqlserver: 2014
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }}
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
architecture: ${{ matrix.arch }}
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm clean-install
Expand All @@ -145,7 +142,7 @@ jobs:
- name: Setup SQL Server
uses: tediousjs/setup-sqlserver@v1
with:
sqlserver-version: ${{ matrix.sql-version }}
sqlserver-version: ${{ matrix.sqlserver }}
sa-password: ${{ env.MSSQL_PASSWORD }}
- name: Store test config
shell: bash
Expand All @@ -155,16 +152,16 @@ jobs:
- name: Run cli tests
run: npm run test-cli
- name: Install msnodesqlv8
if: ${{ matrix.sql-version != '2022' }}
if: ${{ matrix.sqlserver != '2022' && matrix.sqlserver != '2008' }}
run: npm install --no-save msnodesqlv8@^2
- name: Run msnodesqlv8 tests
if: ${{ matrix.sql-version != '2022' }}
if: ${{ matrix.sqlserver != '2022' && matrix.sqlserver != '2008' }}
run: npm run test-msnodesqlv8
release:
name: Release
concurrency: release
if: ${{ github.repository_owner == 'tediousjs' && github.event_name == 'push' && github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- commitlint
- codelint
Expand Down

0 comments on commit 20b1992

Please sign in to comment.