Skip to content

Commit

Permalink
Add CI to formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Jan 25, 2022
1 parent d05c428 commit 0b470a1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,28 @@ jobs:
with:
globs: |
**/*.md
json-lint:
name: Lint json files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache yarn
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install

- name: Verify that json files are formatted correctly
run: yarn test-json-formatting
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"scripts": {
"test": "ajv -s canonical-data.schema.json -d \"exercises/*/canonical-data.json\"",
"test-one": "ajv -s canonical-data.schema.json -d",
"test-format": "prettier --check **/*.json",
"format": "prettier --write **/*.json"
"test-json-formatting": "prettier --check **/*.json"
},
"resolutions": {
"minimist": "^1.2.3"
Expand Down

0 comments on commit 0b470a1

Please sign in to comment.