GitHub actions #6
Workflow file for this run
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
name: Node.js CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [12.x] | |
env: | |
FAIL_IF_DIST_MESSAGE: "These files are autogenerated. Please don't include changes to these files in your PR" | |
TZ: "America/New_York" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Build project | |
run: npm run build | |
- name: Run tests | |
run: npm run coverage | |
- name: Run Coveralls | |
run: npm run coveralls | |
- name: Check for changed dist files | |
run: | | |
DIST_CHANGED=$(git diff --name-only HEAD ${{ github.event.pull_request.base.ref }} | egrep 'rickshaw(\.min)?\.(js|css)') | |
if [[ ! -z "$DIST_CHANGED" ]]; then | |
echo -e "\033[31m${{ env.FAIL_IF_DIST_MESSAGE }} $DIST_CHANGED" | |
exit 1 | |
fi |