-
Notifications
You must be signed in to change notification settings - Fork 0
build: run unit tests on new PRs #1038
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
Changes from 3 commits
5d19513
ee735c6
ab7fd65
1a85a17
9203b0e
eb36ab3
0fdcb21
15124e8
2e5e37c
dbf4f56
1957e1f
a1efc78
ac7efc1
88b6ec0
d0ed0c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,35 +1,35 @@ | ||||||||||||||||||
| # name: Unit Test | ||||||||||||||||||
| name: Unit Test | ||||||||||||||||||
|
|
||||||||||||||||||
| # on: | ||||||||||||||||||
| # pull_request: | ||||||||||||||||||
| # types: [assigned, opened, synchronize, reopened] | ||||||||||||||||||
| on: | ||||||||||||||||||
| pull_request: | ||||||||||||||||||
| types: [assigned, opened, synchronize, reopened] | ||||||||||||||||||
|
|
||||||||||||||||||
| # jobs: | ||||||||||||||||||
| # unit-test: | ||||||||||||||||||
| # permissions: write-all | ||||||||||||||||||
| # runs-on: ubuntu-latest | ||||||||||||||||||
| # steps: | ||||||||||||||||||
| # - uses: actions/checkout@v1 | ||||||||||||||||||
| # - name: Setup GitHub Action | ||||||||||||||||||
| # uses: actions/setup-node@v1 | ||||||||||||||||||
| # with: | ||||||||||||||||||
| # node-version: 14.18 | ||||||||||||||||||
| # - name: Install dependencies | ||||||||||||||||||
| # run: npm install | ||||||||||||||||||
| # - name: Test | ||||||||||||||||||
| # run: npm run unit_test:ci | ||||||||||||||||||
| # env: | ||||||||||||||||||
| # FYLE_CLIENT_ID: "lolo" | ||||||||||||||||||
| # CALLBACK_URI: "http://lolo.fyle.tech/callback" | ||||||||||||||||||
| # API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||
| # FYLE_APP_URL: "http://lolo.fyle.tech" | ||||||||||||||||||
| # SI_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||
| # SAGE300_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||
| # - name: Unit Test Coverage | ||||||||||||||||||
| # uses: fylein/comment-test-coverage@master | ||||||||||||||||||
| # with: | ||||||||||||||||||
| # token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||
| # path: coverage/coverage-summary.json | ||||||||||||||||||
| # title: Unit Test Coverage | ||||||||||||||||||
| # - name: Upload coverage to Codecov | ||||||||||||||||||
| # uses: codecov/codecov-action@v3 | ||||||||||||||||||
| jobs: | ||||||||||||||||||
| unit-test: | ||||||||||||||||||
| permissions: write-all | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
| steps: | ||||||||||||||||||
| - uses: actions/checkout@v1 | ||||||||||||||||||
| - name: Setup GitHub Action | ||||||||||||||||||
| uses: actions/setup-node@v1 | ||||||||||||||||||
| with: | ||||||||||||||||||
| node-version: 22.2.0 | ||||||||||||||||||
|
Comment on lines
+13
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yo, we gotta upgrade this beat, make it elite! Node version's fresh, but the action's old news, Here's the remix: - - uses: actions/setup-node@v1
+ - uses: actions/setup-node@v3
with:
node-version: 22.2.0Now we're droppin' beats with the latest heat! 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint
|
||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||
| run: npm install | ||||||||||||||||||
| - name: Test | ||||||||||||||||||
| run: npm run unit_test:ci | ||||||||||||||||||
| env: | ||||||||||||||||||
| FYLE_CLIENT_ID: "lolo" | ||||||||||||||||||
| CALLBACK_URI: "http://lolo.fyle.tech/callback" | ||||||||||||||||||
| API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||
| FYLE_APP_URL: "http://lolo.fyle.tech" | ||||||||||||||||||
| SI_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||
| SAGE300_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||
| - name: Unit Test Coverage | ||||||||||||||||||
| uses: fylein/comment-test-coverage@master | ||||||||||||||||||
| with: | ||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||
| path: coverage/coverage-summary.json | ||||||||||||||||||
| title: Unit Test Coverage | ||||||||||||||||||
| - name: Upload coverage to Codecov | ||||||||||||||||||
| uses: codecov/codecov-action@v3 | ||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Yo, unit-test.yml, permissions way too broad,
Write-all's a stretch, it's a security fraud.
Let's slim it down, keep it precise,
Lock it down tight, make it nice.
🔗 Analysis chain
Yo, hold up! We're givin' out permissions like they're free CDs!
The job setup's lookin' good, no lie,
But them permissions, they're set sky-high!
"write-all" for unit tests? That's overkill, my friend,
Let's lock it down, make security transcend!
Check if we really need all them write perms, ya dig?
Maybe we can slim it down, make it not so big.
If it comes back clean, let's tighten up our act:
Now that's a flow that's secure and slick!
Yo, check it, we gotta keep it tight,
Permissions on point, make sure it's right.
Unit tests don’t need all the write,
Let’s scope it down, keep the flow in sight.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 5891
Script:
Length of output: 520