Skip to content

Commit

Permalink
chore: Add pr-check script to run tests, linting, and build for pull …
Browse files Browse the repository at this point in the history
…request validation
  • Loading branch information
gabriel-logan committed Jun 10, 2024
1 parent 687b1c9 commit 23ba468
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: [gabriel-logan] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: gabriellogan
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
30 changes: 30 additions & 0 deletions .github/workflows/backend-pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Backend Pull Request Check

on:
pull_request:
branches: [ main ]
paths:
- 'backend/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/

- name: Cd to the directory to test
working-directory: ./backend/typescript
run: |
npm install
npm run pr-check
30 changes: 30 additions & 0 deletions .github/workflows/frontend-pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Frontend Pull Request Check

on:
pull_request:
branches: [ main ]
paths:
- 'frontend/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/

- name: Cd to the directory to test
working-directory: ./frontend/typescript
run: |
npm install
npm run pr-check
3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"pre-commit": "yarn format && yarn lint && yarn test && yarn build && git add ."
"pre-commit": "yarn format && yarn lint && yarn test && yarn build && git add .",
"pr-check": "yarn format && yarn lint && yarn test && yarn build"
},
"dependencies": {
"@nestjs/common": "^10.0.0",
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"pre-commit": "yarn lint && yarn build && git add ."
"pre-commit": "yarn lint && yarn build && git add .",
"pr-check": "yarn lint && yarn build"
},
"dependencies": {
"next": "14.2.3",
Expand Down

0 comments on commit 23ba468

Please sign in to comment.