-
Notifications
You must be signed in to change notification settings - Fork 14
feat(workflows): create 'test.yml' reusable workflow #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
This comment was marked as outdated.
Sorry, something went wrong.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting! Does the |
||||||
| runs-on: ubuntu-latest | ||||||
| needs: test_matrix | ||||||
| steps: | ||||||
| - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||||||
| - run: npm ci | ||||||
| - run: npm run lint --if-present | ||||||
Uh oh!
There was an error while loading. Please reload this page.