Skip to content
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

Improve template CI: add matrix testing, use bahmutov/npm-install #882

Merged
merged 3 commits into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
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
15 changes: 8 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ jobs:
name: Lint & Deduplicate deps on node 10.x and ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
Expand All @@ -27,18 +28,18 @@ jobs:
run: yarn deduplicate:check

test:
runs-on: ${{ matrix.os }}
name: Test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '13.x']
os: [ubuntu-latest, windows-latest, macOS-latest]

name: Test on node ${{ matrix.node }} and ${{ matrix.os }}

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node }}
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
Expand Down
26 changes: 12 additions & 14 deletions templates/basic/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,25 @@ name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Begin CI...
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node 12
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Use cached node_modules
uses: actions/cache@v2
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodeModules-
node-version: ${{ matrix.node }}

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint
Expand Down
2 changes: 1 addition & 1 deletion templates/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rol

Two actions are added by default:

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

## Optimizations
Expand Down
26 changes: 12 additions & 14 deletions templates/react-with-storybook/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,25 @@ name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Begin CI...
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node 12
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Use cached node_modules
uses: actions/cache@v2
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodeModules-
node-version: ${{ matrix.node }}

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint
Expand Down
2 changes: 1 addition & 1 deletion templates/react-with-storybook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rol

Two actions are added by default:

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

## Optimizations
Expand Down
26 changes: 12 additions & 14 deletions templates/react/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,25 @@ name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Begin CI...
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node 12
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Use cached node_modules
uses: actions/cache@v2
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodeModules-
node-version: ${{ matrix.node }}

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint
Expand Down
4 changes: 2 additions & 2 deletions templates/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rol

Two actions are added by default:

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

## Optimizations

Expand Down