-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Crystal Ngai
committed
Mar 9, 2021
1 parent
849d0de
commit e02ced1
Showing
7 changed files
with
125 additions
and
77 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# For all PRs, this workflow will | ||
# - Install deps | ||
# - Lint | ||
# - Typecheck | ||
# - Test | ||
name: CI | ||
|
||
on: | ||
# will run on all PRs that are opened or updated (synchronized) | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
# changelog must be edited for every PR | ||
changelog: | ||
name: Updates Changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dangoslen/[email protected] | ||
with: | ||
changeLogPath: "CHANGELOG.md" | ||
skipLabel: "no-changelog" | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: Use Node Version from nvmrc | ||
uses: actions/setup-node@v1 | ||
with: { node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}" } | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
typecheck: | ||
name: Typecheck | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: Use Node Version from nvmrc | ||
uses: actions/setup-node@v1 | ||
with: { node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}" } | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Typecheck | ||
run: node_modules/typescript/bin/tsc --noEmit | ||
|
||
test: | ||
name: Test & Coverage | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: Use Node Version from nvmrc | ||
uses: actions/setup-node@v1 | ||
with: { node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}" } | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Test | ||
run: npm run test |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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