Skip to content

Commit 8449699

Browse files
committed
feat: add test matrix to all templates' CI
- have been using this internally for about a year now, so should be good to use by general users too - the original proposal to add Actions to all templates also suggested adding matrix testing, but that didn't make it into the original PR - support Node 10, 12, and 14, as well as ubuntu, macOS, and windows latest - add a note in the docs mentioning the test matrix - also fix one doc's missing `size-limit` link - not sure how that got missed - add clear names to all jobs and steps as well - change some to include the matrix variant that is currently running - "Begin CI..." was not really clear, use "Checkout repo" instead
1 parent f109fe9 commit 8449699

6 files changed

Lines changed: 34 additions & 16 deletions

File tree

templates/basic/.github/workflows/main.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@ name: CI
22
on: [push]
33
jobs:
44
build:
5-
runs-on: ubuntu-latest
5+
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
6+
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
node: ['10.x', '12.x', '14.x']
11+
os: [ubuntu-latest, windows-latest, macOS-latest]
612

713
steps:
8-
- name: Begin CI...
14+
- name: Checkout repo
915
uses: actions/checkout@v2
1016

11-
- name: Use Node 12
17+
- name: Use Node ${{ matrix.node }}
1218
uses: actions/setup-node@v1
1319
with:
14-
node-version: 12.x
20+
node-version: ${{ matrix.node }}
1521

1622
- name: Install deps and build (with cache)
1723
uses: bahmutov/npm-install@v1

templates/basic/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rol
6363

6464
Two actions are added by default:
6565

66-
- `main` which installs deps w/ cache, lints, tests, and builds on all pushes
66+
- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
6767
- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)
6868

6969
## Optimizations

templates/react-with-storybook/.github/workflows/main.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@ name: CI
22
on: [push]
33
jobs:
44
build:
5-
runs-on: ubuntu-latest
5+
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
6+
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
node: ['10.x', '12.x', '14.x']
11+
os: [ubuntu-latest, windows-latest, macOS-latest]
612

713
steps:
8-
- name: Begin CI...
14+
- name: Checkout repo
915
uses: actions/checkout@v2
1016

11-
- name: Use Node 12
17+
- name: Use Node ${{ matrix.node }}
1218
uses: actions/setup-node@v1
1319
with:
14-
node-version: 12.x
20+
node-version: ${{ matrix.node }}
1521

1622
- name: Install deps and build (with cache)
1723
uses: bahmutov/npm-install@v1

templates/react-with-storybook/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rol
103103

104104
Two actions are added by default:
105105

106-
- `main` which runs installs deps w/ cache, lints, tests, and builds on all pushes
106+
- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
107107
- `size` which comments cost comparison of your library on every pull request using [size-limit](https://github.com/ai/size-limit)
108108

109109
## Optimizations

templates/react/.github/workflows/main.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@ name: CI
22
on: [push]
33
jobs:
44
build:
5-
runs-on: ubuntu-latest
5+
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
6+
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
node: ['10.x', '12.x', '14.x']
11+
os: [ubuntu-latest, windows-latest, macOS-latest]
612

713
steps:
8-
- name: Begin CI...
14+
- name: Checkout repo
915
uses: actions/checkout@v2
1016

11-
- name: Use Node 12
17+
- name: Use Node ${{ matrix.node }}
1218
uses: actions/setup-node@v1
1319
with:
14-
node-version: 12.x
20+
node-version: ${{ matrix.node }}
1521

1622
- name: Install deps and build (with cache)
1723
uses: bahmutov/npm-install@v1

templates/react/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rol
8282

8383
Two actions are added by default:
8484

85-
- `main` which runs installs deps w/ cache, lints, tests, and builds on all pushes
86-
- `size` which comments cost comparison of your library on every pull request using
85+
- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
86+
- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)
8787

8888
## Optimizations
8989

0 commit comments

Comments
 (0)