ci: add tests #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, typescript, eslint & stylelint checks | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
# Install and cache npm dependencies | |
install-cache: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache npm dependencies | |
uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm | |
- name: Install dependencies if cache invalid | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
run: npm install | |
# Build Storybook | |
build: | |
runs-on: ubuntu-latest | |
needs: install-cache | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Restore npm dependencies | |
uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm | |
- name: Run ESLint | |
run: npm run lint | |
- name: Run Stylelint | |
run: npm run lint:css | |
- name: Build Storybook | |
run: npm run build-storybook |