Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: minor changes to github actions #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
name: Check Lighthouse
name: Check Lighthouse score

on:
# Runs on pushes targeting the default branch
pull_request:
branches: ["master"]

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

jobs:
check-lighthouse:
verify-lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Lighthouse
uses: foo-software/lighthouse-check-action@master
- name: Audit Netlify deploy preview
uses: jakejarvis/lighthouse-action@master
with:
accessToken: ${{ secrets.GH_TOKEN }}
urls: "https://recoiltodo.netlify.app"
- name: Verify Lighthouse reports
uses: treosh/lighthouse-ci-action@v9
netlify_site: "recoiltodo.netlify.app"
- uses: actions/upload-artifact@master
with:
urls: "https://recoiltodo.netlify.app"
budgetPath: ".github/configs/budget.json"
configPath: ".github/configs/lighthouserc.json"
name: report
path: "./report"
7 changes: 3 additions & 4 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ concurrency:

jobs:
# Single deploy job since we're just deploying
deploy:
test-coverage:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
- name: Generate Coverage
run: |
yarn
Expand All @@ -40,7 +39,7 @@ jobs:
uses: actions/upload-pages-artifact@v1
with:
# Upload coverage directory
path: './coverage/lcov-report'
path: "./coverage/lcov-report"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/source_maps

# misc
.env
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@
"name": "Sunny Prakash"
},
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"recoil": "^0.4.1",
"rollbar": "^2.24.0",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
"scripts": {
Expand Down Expand Up @@ -46,6 +38,14 @@
]
},
"devDependencies": {
"@testing-library/react-hooks": "^7.0.2"
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"typescript": "^4.1.2"
}
}
8 changes: 6 additions & 2 deletions src/common-components/TestRollbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ const TestRollbar = () => {
throw new Error("Random error occured");
};

if (process.env.NODE_ENV !== "development") return null;
const throwPromise = () => {
Promise.reject("Promise is unhandled");
}

return (
<div style={{ textAlign: "center" }}>
<button onClick={throwError}>Test Rollbar</button>
<button onClick={throwError}>Throw Error</button>
<br />
<button onClick={throwPromise}>Promise Rejection</button>
</div>
);
};
Expand Down
7 changes: 7 additions & 0 deletions src/helpers/useRollbarConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ const useRollbarConfig = () => {
payload: {
person: { id: email, email },
environment: process.env.NODE_ENV,
client: {
javascript: {
source_map_enabled: true,
code_version: '1',
guess_uncaught_frames: true
}
}
}
});
setRollbar(rollbar);
Expand Down
Loading