-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#1) Updating GitHub Action to not just build and test but also lint …
…the code and commit messages.
- Loading branch information
Showing
2 changed files
with
50 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Validate Push | ||
|
||
on: [push] | ||
|
||
jobs: | ||
run-tests-and-linters: | ||
name: All tests and linters | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
# We don't just checkout the last commit, but all commits | ||
# This is so the commitlint GitHub Action below can lint commit messages | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: npm install and build | ||
run: | | ||
npm install | ||
npm run link:packages | ||
npm run build:packages | ||
env: | ||
CI: true | ||
|
||
- name: Run Tests | ||
run: npm run test:packages | ||
env: | ||
CI: true | ||
|
||
- name: Run linters | ||
uses: samuelmeuli/lint-action@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
# Enable linters | ||
eslint: true | ||
prettier: true | ||
|
||
- name: Set NODE_PATH so the commitlint action picks up the custom commitlint plugin from the Node.js dependencies | ||
# $GITHUB_WORKSPACE is the path to your repository | ||
run: echo "::set-env name=NODE_PATH::${GITHUB_WORKSPACE}/node_modules" | ||
|
||
- name: Run commitlint action | ||
uses: wagoid/commitlint-github-action@v1 | ||
# Uses default configuration under commitlint.config.js |