Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
workflow_call:
inputs:
node_versions:
required: true
type: string

jobs:
test_matrix:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: ${{ fromJson(inputs.node_versions) }}
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: "Test with Node.js ${{ matrix.node_version }}"
uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a # tag=v3
with:
node-version: "${{ matrix.node_version }}"
cache: npm
- run: npm ci
- run: npm run test --ignore-scripts # run lint only once
test:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of renaming this job to be more indicative?

Suggested change
test:
lint:

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not just linting, we also test things that are independent of node versions, e.g. type tests

Copy link

@timrogers timrogers Jul 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! Does the lint npm script do all of those things? (I made this suggestion because the only substantive command in the steps is to run the lint script.)

runs-on: ubuntu-latest
needs: test_matrix
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- run: npm ci
- run: npm run lint --if-present