diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 20f7f01c5..d718006ab 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -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 @@ -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 }} diff --git a/templates/basic/.github/workflows/main.yml b/templates/basic/.github/workflows/main.yml index d40f0f8f6..535e4b7c9 100644 --- a/templates/basic/.github/workflows/main.yml +++ b/templates/basic/.github/workflows/main.yml @@ -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 diff --git a/templates/basic/README.md b/templates/basic/README.md index 0e115bfd2..93eb55df4 100644 --- a/templates/basic/README.md +++ b/templates/basic/README.md @@ -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 diff --git a/templates/react-with-storybook/.github/workflows/main.yml b/templates/react-with-storybook/.github/workflows/main.yml index d40f0f8f6..535e4b7c9 100644 --- a/templates/react-with-storybook/.github/workflows/main.yml +++ b/templates/react-with-storybook/.github/workflows/main.yml @@ -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 diff --git a/templates/react-with-storybook/README.md b/templates/react-with-storybook/README.md index f5e0dd69a..134273f32 100644 --- a/templates/react-with-storybook/README.md +++ b/templates/react-with-storybook/README.md @@ -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 diff --git a/templates/react/.github/workflows/main.yml b/templates/react/.github/workflows/main.yml index d40f0f8f6..535e4b7c9 100644 --- a/templates/react/.github/workflows/main.yml +++ b/templates/react/.github/workflows/main.yml @@ -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 diff --git a/templates/react/README.md b/templates/react/README.md index 1f020dd28..1db53ccd9 100644 --- a/templates/react/README.md +++ b/templates/react/README.md @@ -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