Skip to content

Commit

Permalink
Add CI linting check (#22)
Browse files Browse the repository at this point in the history
* Implement Linting check during CI

* Set severity limit to hint+

* Cache node_modules

* Add linting config and change severity threshold to warn

* Update package.json
  • Loading branch information
Foorack authored Jul 16, 2021
1 parent e5d757f commit 00fac57
Show file tree
Hide file tree
Showing 8 changed files with 1,931 additions and 254 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ on: [push, pull_request]
name: Continuous Integration

jobs:
lint:
runs-on: ubuntu-latest
name: Lint OpenAPI specification
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/checkout@v2
- name: 'Cache node_modules'
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-v12-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-v12
- name: Install Dependencies
run: npm install
- name: Run Spectral linting
run: npm run lint

bundle:
runs-on: ubuntu-latest
name: Bundle OpenAPI specification
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
10 changes: 10 additions & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
formats:
- oas3
extends:
- 'spectral:oas'
rules:
contact-properties: warn
info-license: warn
license-url: warn
oas3-parameter-description: info
tag-description: hint
24 changes: 12 additions & 12 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ paths:
examples:
Example Response:
value:
url: 'https://s3.amazonaws.com/files.vrchat.cloud/Avatar-MyAvatar-Un.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage?AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXX&Expires=1626028518&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&partNumber=1&uploadId=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx'
url: 'https://s3.amazonaws.com/files.vrchat.cloud/Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage?AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXX&Expires=1626028518&Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&partNumber=1&uploadId=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx'
'400':
description: Error response when trying to start an upload against a FileVersion that is already marked as `complete`.
content:
Expand Down Expand Up @@ -1222,10 +1222,10 @@ components:
examples:
Example Avatar File:
value:
id: file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
id: file_00000000-0000-0000-0000-000000000000
name: Avatar - Test Avatar - Unity package - 2017․4․28f1_3_standalonewindows_Release
ownerId: usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469
mimeType: application/gzip
mimeType: 'applicationgzip'
extension: .unitypackage
tags: []
versions:
Expand All @@ -1236,24 +1236,24 @@ components:
status: complete
created_at: '2019-08-15T11:04:49.702Z'
file:
fileName: Avatar-Test-Avatar-Unity.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage
url: 'https://s3.us-east-1.amazonaws.com/files.vrchat.cloud/Avatar-Test-Avatar-Unity.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage'
fileName: Avatar-Test-Avatar-Unity.file_00000000-0000-0000-0000-000000000000.1.unitypackage
url: 'https://s3.us-east-1.amazonaws.com/files.vrchat.cloud/Avatar-Test-Avatar-Unity.file_00000000-0000-0000-0000-000000000000.1.unitypackage'
md5: xxxxxxxxxxxxxxxxxxx==
sizeInBytes: 303055180
status: complete
category: multipart
uploadId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
delta:
fileName: Avatar-Test-Avatar-Unity.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage.delta
url: 'https://s3.us-east-1.amazonaws.com/files.vrchat.cloud/Avatar-Test-Avatar-Unity.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage.delta'
fileName: Avatar-Test-Avatar-Unity.file_00000000-0000-0000-0000-000000000000.1.unitypackage.delta
url: 'https://s3.us-east-1.amazonaws.com/files.vrchat.cloud/Avatar-Test-Avatar-Unity.file_00000000-0000-0000-0000-000000000000.1.unitypackage.delta'
md5: ''
sizeInBytes: 0
status: none
category: queued
uploadId: ''
signature:
fileName: Avatar-Test-Avatar-Unity.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage.signature
url: 'https://s3.us-east-1.amazonaws.com/files.vrchat.cloud/Avatar-Test-Avatar-Unity.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage.signature'
fileName: Avatar-Test-Avatar-Unity.file_00000000-0000-0000-0000-000000000000.1.unitypackage.signature
url: 'https://s3.us-east-1.amazonaws.com/files.vrchat.cloud/Avatar-Test-Avatar-Unity.file_00000000-0000-0000-0000-000000000000.1.unitypackage.signature'
md5: xxxxxxxxxxxxxxxx==
sizeInBytes: 532748
status: complete
Expand Down Expand Up @@ -1337,7 +1337,7 @@ components:
fileName:
type: string
minLength: 1
example: Avatar-MyAvatar-Un.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage
example: Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage
readOnly: true
nextPartNumber:
type: number
Expand Down Expand Up @@ -1376,7 +1376,7 @@ components:
Example Access Key:
value:
uploadId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxx
fileName: Avatar-MyAvatar-Un.file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.1.unitypackage
fileName: Avatar-MyAvatar-Un.file_00000000-0000-0000-0000-000000000000.1.unitypackage
nextPartNumber: 0
maxParts: 1000
parts: []
Expand Down Expand Up @@ -1414,7 +1414,7 @@ components:
required: true
schema:
type: string
example: file_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
example: file_00000000-0000-0000-0000-000000000000
pattern: 'file_[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}'
versionId:
name: versionId
Expand Down
Loading

0 comments on commit 00fac57

Please sign in to comment.