Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: break checks ci job into separate jobs #1114

Merged
merged 11 commits into from
Nov 10, 2022
95 changes: 93 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- master

jobs:
check:
lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand All @@ -34,12 +34,103 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install JS dependencies
run: yarn install

- name: Linter.
run: yarn lint:ci
tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- name: Checkout files
uses: actions/checkout@v3

- name: Install Node v16
uses: actions/setup-node@v3
with:
node-version: '16.13'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
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-

- name: Install JS dependencies
run: yarn install

- name: Unit tests.
run: yarn test

build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- name: Checkout files
uses: actions/checkout@v3

- name: Install Node v16
uses: actions/setup-node@v3
with:
node-version: '16.13'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
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-

- name: Install JS dependencies
run: yarn install

- name: Build
run: yarn build

build-docs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- name: Checkout files
uses: actions/checkout@v3

- name: Install Node v16
uses: actions/setup-node@v3
with:
node-version: '16.13'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
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-

- name: Install JS dependencies
run: yarn install

- name: Build Docs
run: yarn build:docs