From ee5121bcde941925a7400adba460f7f835ce04b7 Mon Sep 17 00:00:00 2001 From: Austin Sullivan Date: Wed, 2 Nov 2022 08:57:36 -0400 Subject: [PATCH] add linting gh action --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ef51b3..d0ba57b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,3 +39,39 @@ jobs: - name: Build dist run: yarn build if: steps.dist.outputs.cache-hit != 'true' + lint: + runs-on: ubuntu-latest + env: + GH_PR_NUM: ${{ github.event.number }} + needs: build + steps: + - uses: actions/checkout@v2 + - run: | + if [[ ! -z "${GH_PR_NUM}" ]]; then + echo "Checking out PR" + git fetch origin pull/$GH_PR_NUM/head:tmp + git checkout tmp + fi + - uses: actions/setup-node@v1 + with: + node-version: '14' + - uses: actions/cache@v2 + id: yarn-cache + name: Cache npm deps + with: + path: | + node_modules + **/node_modules + key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + - uses: actions/cache@v2 + id: lint-cache + name: Load lint cache + with: + path: '.eslintcache' + key: ${{ runner.os }}-lint-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} + - name: ESLint + run: yarn lint:js + - name: MDLint + run: yarn lint:md