Skip to content

Commit

Permalink
chore(ci): add unit tests to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Jul 13, 2023
1 parent d4108e8 commit cf6d5a2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: Lint & Test

on: ['pull_request']

Expand Down Expand Up @@ -41,3 +41,23 @@ jobs:
run: npm clean-install
- name: Lint code
run: npm run lint
unittest:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
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
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,34 @@ jobs:
run: npm clean-install
- name: Lint code
run: npm run lint
unittest:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
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
release:
name: Release
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
needs:
- commitlint
- lintcode
- unittest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
Expand Down

0 comments on commit cf6d5a2

Please sign in to comment.