WebStudio/.github/workflows/main.yml
2020-04-19 18:31:42 +02:00

54 lines
1.6 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: Checks
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
typescript:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install --frozen-lockfile
# Type checks
- name: TypeScript Error Reporter
uses: icrawl/action-tsc@v1
# ESLint
- name: ESLint Action
run: node_modules/.bin/eslint src/ --ext .ts,.tsx
# Prettier
- name: Prettify the JS Code
uses: creyD/prettier_action@v2.1
with:
prettier_options: '--write src/**/*.{js,ts,tsx,css,scss}'
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}