Skip to content

Commit

Permalink
ci: assert yarn prints no warnings (#5565)
Browse files Browse the repository at this point in the history
* Assert in CI yarn prints no warnings

* Add exit 1
  • Loading branch information
dapplion authored Jun 27, 2023
1 parent e35fae0 commit 46ebb53
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
path: packages/validator/spec-tests
key: spec-test-data-${{ hashFiles('packages/validator/test/spec/params.ts') }}

- name: Assert yarn prints no warnings
run: scripts/assert_no_yarn_warnings.sh

# Misc sanity checks
- name: Lint Grafana dashboards
run: scripts/validate-grafana-dashboards.sh
Expand Down
14 changes: 14 additions & 0 deletions scripts/assert_no_yarn_warnings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# run yarn install --check-files, capturing stderr
OUTPUT=$(yarn install --check-files 2>&1)

echo $OUTPUT

# grep the output for 'warning'
if echo "$OUTPUT" | grep -qi 'warning'; then
echo "There were warnings in yarn install --check-files"
exit 1
else
echo "No warnings in yarn install --check-files"
fi

0 comments on commit 46ebb53

Please sign in to comment.