Merge pull request #20 from anvilco/df/publish-better #85
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: Linting | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: test | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: node_modules | |
key: v1-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
v1- | |
- name: Install dependencies with yarn | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
run: yarn install | |
lint: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: node_modules | |
key: v1-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
v1- | |
- name: Run Linter | |
if: steps.yarn-cache.outputs.cache-hit == 'true' | |
run: yarn lint | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: node_modules | |
key: v1-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
v1- | |
- name: Run Tests | |
if: steps.yarn-cache.outputs.cache-hit == 'true' | |
run: yarn test |