-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflows for linting and testing (#50)
* Add npm scripts * Add workflows * Update working-directory config * Fix Jest config file * Swap matrix-based config for env-based config * Allow CI to pass with no tests * Revert "Swap matrix-based config for env-based config" This reverts commit b0a0e09.
- Loading branch information
Showing
4 changed files
with
85 additions
and
2 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,34 @@ | ||
name: Cache Dependencies | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
cache-dependencies: | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
node-version: | ||
- 16 | ||
runs-on: ${{ matrix.os }} | ||
name: Cache Dependencies | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js for use with actions | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Setup dependency cache | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.os }}-node-${{ matrix.node-version }}-${{ hashFiles('functions/package-lock.json') }} | ||
- name: Install dependencies | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
run: npm ci | ||
working-directory: functions |
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,47 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
node-version: | ||
- 16 | ||
name: CI | ||
steps: | ||
- name: Configure Git | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js for use with actions | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Setup dependency cache | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.os }}-node-${{ matrix.node-version }}-${{ hashFiles('functions/package-lock.json') }} | ||
- name: Install dependencies | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
run: npm ci | ||
working-directory: functions | ||
- name: Lint code | ||
run: npm run lint:code | ||
working-directory: functions | ||
- name: Lint styling | ||
run: npm run lint:style | ||
working-directory: functions | ||
- name: Run unit tests | ||
run: npm run test:unit:coverage -- --passWithNoTests | ||
working-directory: functions |
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