Skip to content

Commit

Permalink
ci: added action to fail on build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
blockchainguyy committed Oct 9, 2023
1 parent 1581435 commit 45b154f
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Ensure no warning when compiling

on:
- pull_request

jobs:
build:
strategy:
matrix:
node-version:
- 18.x
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Build project and capture output
run: npm run build > build.log 2>&1

- name: Check for build errors
run: |
if grep -q "error" build.log || grep -q "Error" build.log || grep -q "warning" build.log || grep -q "Warning" build.log; then
echo "Build contains following errors or warnings..."
cat build.log
exit 1
else
exit 0;
fi

0 comments on commit 45b154f

Please sign in to comment.