-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#25: Lint and unit tests on GitHub Actions
- Loading branch information
Showing
9 changed files
with
122 additions
and
609 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,44 @@ | ||
name: Lint Code | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
tests: | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
TERM: xterm | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
node-version: | ||
- '14' | ||
# @TODO: Use leia for functional testing | ||
# leia-tests: | ||
# - apache-example | ||
steps: | ||
# Install deps and cache | ||
# Eventually it would be great if these steps could live in a separate YAML file | ||
# that could be included in line to avoid code duplication | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Get Yarn cache directory | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: Use Yarn cache | ||
uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} | ||
- name: Install Yarn dependencies | ||
run: yarn install --prefer-offline --frozen-lockfile | ||
|
||
# Lint Code | ||
- name: Lint code | ||
run: yarn test |
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,46 @@ | ||
name: Run Unit Tests | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
tests: | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
TERM: xterm | ||
strategy: | ||
matrix: | ||
os: | ||
- macos-10.15 | ||
- ubuntu-20.04 | ||
- windows-2019 | ||
node-version: | ||
- '14' | ||
# @TODO: Use leia for functional testing | ||
# leia-tests: | ||
# - apache-example | ||
steps: | ||
# Install deps and cache | ||
# Eventually it would be great if these steps could live in a separate YAML file | ||
# that could be included in line to avoid code duplication | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Get Yarn cache directory | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: Use Yarn cache | ||
uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} | ||
- name: Install Yarn dependencies | ||
run: yarn install --prefer-offline --frozen-lockfile | ||
|
||
# Run unit tests | ||
- name: Run units tests | ||
run: yarn test |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env node | ||
|
||
require('@oclif/command').run() | ||
require('@oclif/command') | ||
.run() | ||
.then(require('@oclif/command/flush')) | ||
.catch(require('@oclif/errors/handle')) | ||
.catch(require('@oclif/errors/handle')); |
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
Oops, something went wrong.