mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
Add a slightly better linter check (#2446)
* Remove the NPM cache from the validate_icons step * Add a prettier formatting check --------- Co-authored-by: ligi <ligi@ligi.de>
This commit is contained in:
parent
cd4e352b0a
commit
93c61b12f2
43
.github/workflows/pr_checks.yml
vendored
43
.github/workflows/pr_checks.yml
vendored
|
@ -24,15 +24,6 @@ jobs:
|
||||||
files: _data/icons/*.json
|
files: _data/icons/*.json
|
||||||
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
||||||
|
|
||||||
- name: Configure npm Caching
|
|
||||||
uses: actions/cache@v2
|
|
||||||
if: steps.changed-icons.outputs.any_changed == 'true'
|
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/workflows/validate_json.yml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-npm-
|
|
||||||
|
|
||||||
- run: sudo apt-get -y install jq curl exiftool
|
- run: sudo apt-get -y install jq curl exiftool
|
||||||
|
|
||||||
- name: Verify the changed icons
|
- name: Verify the changed icons
|
||||||
|
@ -97,3 +88,37 @@ jobs:
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
exit $BAD
|
exit $BAD
|
||||||
|
|
||||||
|
validate_formatting:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: nrwl/nx-set-shas@v3
|
||||||
|
id: last_successful_commit_push
|
||||||
|
with:
|
||||||
|
main-branch-name: master
|
||||||
|
workflow-id: 'pr_checks.yml'
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v35
|
||||||
|
with:
|
||||||
|
files: _data/*/*.json
|
||||||
|
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
||||||
|
|
||||||
|
- run: sudo npm i -g prettier
|
||||||
|
|
||||||
|
- name: Verify the changed icons
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
BAD=0
|
||||||
|
|
||||||
|
for CHANGED_FILE in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||||
|
echo "Checking $CHANGED_FILE"
|
||||||
|
diff -u "$CHANGED_FILE" <(prettier "$CHANGED_FILE")
|
||||||
|
done
|
||||||
|
|
1
.github/workflows/prettier.yml
vendored
1
.github/workflows/prettier.yml
vendored
|
@ -2,7 +2,6 @@ name: Run prettier
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prettier:
|
prettier:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user