Skip to content

Commit

Permalink
(#1) Updating GitHub Action to not just build and test but also lint …
Browse files Browse the repository at this point in the history
…the code and commit messages.
  • Loading branch information
danrivett committed Feb 22, 2020
1 parent 7bd24f2 commit d5141f7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/tests-runner.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/validate-push.yml
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

0 comments on commit d5141f7

Please sign in to comment.