Skip to content

Commit

Permalink
Merge pull request #3 from jharlow/feat-pr-workflow-1
Browse files Browse the repository at this point in the history
feat: first pr workflow
  • Loading branch information
jharlow authored Oct 10, 2024
2 parents 8986e0f + 7ea34c4 commit 4e03cbd
Show file tree
Hide file tree
Showing 12 changed files with 470 additions and 19 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: PR Checks
on:
pull_request:
branches: [main]
jobs:
quality-check:
name: Node Quality Check
runs-on: ubuntu-latest
env:
PORT: 8000
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Setup DynamoDB local
run: docker run -d -p 8000:8000 amazon/dynamodb-local:latest
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install packages
run: npm install
- name: Run build command
run: npm run build --if-present
- name: Run ESLint
run: npm run lint --if-present
- name: Run test suite
run: npm run test run
- name: Run 100% coverage check
run: npm run coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
coverage
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"clean": "tsc --build --clean && rm -rf dist",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"test": "vitest"
"test": "vitest",
"coverage": "vitest run --coverage"
},
"author": "John Harlow",
"license": "MIT",
Expand All @@ -23,6 +24,7 @@
"@types/aws-lambda": "^8.10.145",
"@types/eslint__js": "^8.42.3",
"@types/node": "^22.7.5",
"@vitest/coverage-v8": "2.1.2",
"aws-lambda": "^1.0.7",
"dynamo-db-local": "^9.2.1",
"dynamodb-onetable": "^2.7.5",
Expand Down
Loading

0 comments on commit 4e03cbd

Please sign in to comment.