Skip to content

Commit 0b470a1

Browse files
Add CI to formatting
1 parent d05c428 commit 0b470a1

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,28 @@ jobs:
126126
with:
127127
globs: |
128128
**/*.md
129+
130+
json-lint:
131+
name: Lint json files
132+
runs-on: ubuntu-latest
133+
steps:
134+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
135+
136+
- name: Get yarn cache directory path
137+
id: yarn-cache-dir-path
138+
run: echo "::set-output name=dir::$(yarn cache dir)"
139+
140+
- name: Cache yarn
141+
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
142+
id: yarn-cache
143+
with:
144+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
145+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
146+
restore-keys: |
147+
${{ runner.os }}-yarn-
148+
149+
- name: Install dependencies
150+
run: yarn install
151+
152+
- name: Verify that json files are formatted correctly
153+
run: yarn test-json-formatting

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"scripts": {
1414
"test": "ajv -s canonical-data.schema.json -d \"exercises/*/canonical-data.json\"",
1515
"test-one": "ajv -s canonical-data.schema.json -d",
16-
"test-format": "prettier --check **/*.json",
17-
"format": "prettier --write **/*.json"
16+
"test-json-formatting": "prettier --check **/*.json"
1817
},
1918
"resolutions": {
2019
"minimist": "^1.2.3"

0 commit comments

Comments
 (0)