Skip to content

Commit

Permalink
fix: add static tooling (#60)
Browse files Browse the repository at this point in the history
* add validate workflow

* add ignore static-tools branch for format

* Revert "add ignore static-tools branch for format"

This reverts commit 3c39807.

* re-install @seamapi/types from npmjs

* ci - format code

---------

Co-authored-by: Seam Bot <devops@getseam.com>
  • Loading branch information
mikewuu and seambot authored Jan 3, 2024
1 parent 56a7367 commit 82e9139
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 183 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Validate
on:
push:
branches:
- "**" # all branches
- "!main"
pull_request:
branches:
- main

jobs:
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com
- name: NPM Install
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GWM_GH_TOKEN}}
- name: Build
run: npm run build
- name: Check types...
run: npm run typecheck

format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com
- name: NPM Install
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GWM_GH_TOKEN}}
- name: Format...
run: npm run format

- name: Commit and push changes (if any)
uses: stefanzweifel/git-auto-commit-action@v4.2.0
id: auto_commit_action
with:
commit_user_name: seambot
commit_user_email: devops@getseam.com
commit_author: Seam Bot <devops@getseam.com>
commit_message: ci - format code

- name: Success
if: steps.auto_commit_action.outputs.changes_detected == 'false'
run: echo "Format check... PASS!"

- name: Fail
if: steps.auto_commit_action.outputs.changes_detected == 'true'
run: echo "Fixed formatting, and pushed changes" && exit 1
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"semi": false,
"singleQuote": false,
"trailingComma": "es5"
}
}
196 changes: 21 additions & 175 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
},
"dependencies": {
"@seamapi/http": "^0.12.0",
"@seamapi/types": "^1.75.0",
"open": "^10.0.2",
"@seamapi/types": "^1.74.0",
"swagger-parser": "^10.0.3"
}
}
7 changes: 1 addition & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,5 @@
"bun-types" // add Bun global
]
},
"include": [
"lib/**/*.ts",
"cli.ts",
"index.ts",
"package.json"
]
"include": ["lib/**/*.ts", "cli.ts", "index.ts", "package.json"]
}

0 comments on commit 82e9139

Please sign in to comment.