Skip to content

Commit

Permalink
ci(testing): separate lint from test (#6951)
Browse files Browse the repository at this point in the history
* ci(testing): separate lint from test
* refactor(scripts): extract lint.sh
  • Loading branch information
caugner authored Aug 29, 2022
1 parent dea548d commit 015d172
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 14 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
pull_request:

jobs:
build:
lint:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -41,6 +41,31 @@ jobs:
- name: Lint ESLint
run: yarn eslint

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('.github/workflows/testing.yml') }}

- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: |
yarn --frozen-lockfile
- name: Unit testing client
run: yarn test:client

Expand Down
23 changes: 23 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env sh

# Script equivalent of .github/workflows/testing.yml -> lint

set -e

echo "-------------------------"
echo "Install all yarn packages"
echo "-------------------------"

yarn --frozen-lockfile

echo "-------------"
echo "Lint prettier"
echo "-------------"

yarn prettier-check

echo "-----------"
echo "Lint ESLint"
echo "-----------"

yarn eslint
14 changes: 1 addition & 13 deletions scripts/testing.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# Script equivalent of .github/workflows/testing.yml
# Script equivalent of .github/workflows/testing.yml -> test

set -e

Expand All @@ -10,18 +10,6 @@ echo "-------------------------"

yarn --frozen-lockfile

echo "-------------"
echo "Lint prettier"
echo "-------------"

yarn prettier-check

echo "-----------"
echo "Lint ESLint"
echo "-----------"

yarn eslint

echo "-------------------"
echo "Unit testing client"
echo "-------------------"
Expand Down

0 comments on commit 015d172

Please sign in to comment.