Skip to content

Commit

Permalink
Add lint and format check
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
jackkleeman committed Aug 16, 2023
1 parent ec7dfb1 commit e07b9d8
Show file tree
Hide file tree
Showing 6 changed files with 971 additions and 2,586 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
# prevent from running on forks
if: github.repository_owner == 'restatedev'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [19.x]

steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
env:
GH_PACKAGE_READ_ACCESS_TOKEN: ${{ secrets.GH_PACKAGE_READ_ACCESS_TOKEN }}
- run: npm run verify
working-directory: lambda-greeter
- run: npm run verify
working-directory: payment-api
- run: npm run verify
working-directory: ticket-reservation
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@restatedev:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${GH_PACKAGE_READ_ACCESS_TOKEN}
1 change: 1 addition & 0 deletions lambda-greeter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"scripts": {
"lint": "eslint --ignore-path .eslintignore --ext .ts .",
"format": "prettier --ignore-path .eslintignore --write \"**/*.+(js|ts|json)\"",
"verify": "npm run format -- --check && npm run lint && npm run build",
"build": "tsc --noEmitOnError",
"bundle": "esbuild src/app.ts --bundle --minify --sourcemap --platform=node --target=es2020 --outfile=dist/index.js",
"postbundle": "cd dist && zip -r index.zip index.js*",
Expand Down
Loading

0 comments on commit e07b9d8

Please sign in to comment.