mirror of
https://github.com/streamich/react-use.git
synced 2025-12-08 18:02:14 +00:00
* Reconfigure GitHub workflows * Add storybook section * Add lint:types * Fix typo * Remove Windows machines from the matrix
94 lines
1.8 KiB
YAML
94 lines
1.8 KiB
YAML
name: Check codebase
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Run build
|
|
run: yarn build
|
|
|
|
storybook:
|
|
name: Storybook
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Run build:storybook
|
|
run: yarn storybook:build
|
|
|
|
lint:
|
|
name: Linting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Lint with ESLint
|
|
run: yarn lint
|
|
|
|
- name: Lint with TSC
|
|
if: ${{ always() }}
|
|
run: yarn lint:types
|
|
|
|
unit-tests:
|
|
name: Unit tests
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest]
|
|
node: [12, 14, 16]
|
|
exclude:
|
|
- os: macos-latest
|
|
node: 12
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Run unit tests
|
|
run: yarn test
|