-
Notifications
You must be signed in to change notification settings - Fork 11
chore: add github actions for linting and formatting checks #38
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c5017de
chore: add github actions for linting and formatting checks
gregjopa 91a5c7a
debug
gregjopa 3dce585
more debugging
gregjopa b6bdf76
test for formatting error
gregjopa 7bb894b
moar debuggin g
gregjopa d94c647
chore: install deps
gregjopa f3e3335
use npm install since no package-lock
gregjopa d7cb518
try again
gregjopa fe0faf5
add prettier checks
gregjopa f228cb5
sneaking node_modules
gregjopa 514e5e8
fix: format code
gregjopa d523e7d
Gotta love bash
gregjopa c642e09
fix bash
gregjopa e160524
try again
gregjopa 8c1db78
here we go again
gregjopa d44dd18
get linting step to work
gregjopa f2b4772
test grouping
gregjopa 78cd448
TIL groups are awesome
gregjopa 948294e
Rename workflow to nodejs
gregjopa 61b532d
remove extra log
gregjopa b67237a
PR feedback: remove npx
gregjopa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: nodejs | ||
on: | ||
# run on push but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
# run for every pull request | ||
pull_request: {} | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 🤝 Set Node version from .nvmrc | ||
run: echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NVMRC }} | ||
|
||
- name: 📥 Download deps | ||
run: > | ||
find . -name package.json -maxdepth 10 -type f -not -path "*/node_modules/*" | while read -r file; do | ||
directory=$(dirname "$file") | ||
echo "::group:: $directory" | ||
cd "$directory" && npm install && cd - | ||
echo "::endgroup::" | ||
done | ||
|
||
- name: 🧹 Check code formatting with Prettier | ||
run: > | ||
find . -name package.json -maxdepth 10 -type f -not -path "*/node_modules/*" | while read -r file; do | ||
directory=$(dirname "$file") | ||
echo "::group:: $directory" | ||
cd "$directory" && npm run format:check && cd - | ||
echo "::endgroup::" | ||
done | ||
|
||
- name: 👕 Lint code with ESLint | ||
run: > | ||
find . -name package.json -maxdepth 10 -type f -not -path "*/node_modules/*" | while read -r file; do | ||
directory=$(dirname "$file") | ||
echo "::group:: $directory" | ||
cd "$directory" && npm run lint && cd - | ||
echo "::endgroup::" | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Save Payment Sample Integrations - PayPal Web SDK</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
</head> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Save Payment Sample Integrations - PayPal Web SDK</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
</head> | ||
|
||
<body> | ||
<h1>Save Payment Integrations</h1> | ||
|
||
<ul> | ||
<li> | ||
<a href="/recommended/index.html">Recommended integration with PayPal button</a> | ||
</li> | ||
</ul> | ||
</body> | ||
<body> | ||
<h1>Save Payment Integrations</h1> | ||
|
||
<ul> | ||
<li> | ||
<a href="/recommended/index.html" | ||
>Recommended integration with PayPal button</a | ||
> | ||
</li> | ||
</ul> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Save Payment - Recommended Integration - PayPal Web SDK</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<style> | ||
.buttons-container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 12px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Save Payment - Recommended Integration - PayPal Web SDK</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<style> | ||
.buttons-container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 12px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Save Payment Recommended Integration</h1> | ||
|
||
<body> | ||
<h1>Save Payment Recommended Integration</h1> | ||
|
||
<div class="buttons-container"> | ||
<paypal-button id="paypal-button" type="pay" hidden></paypal-button> | ||
</div> | ||
<script src="app.js"></script> | ||
|
||
<script async src="https://www.sandbox.paypal.com/web-sdk/v6/core" onload="onPayPalLoaded()"></script> | ||
</body> | ||
<div class="buttons-container"> | ||
<paypal-button id="paypal-button" type="pay" hidden></paypal-button> | ||
</div> | ||
<script src="app.js"></script> | ||
|
||
<script | ||
async | ||
src="https://www.sandbox.paypal.com/web-sdk/v6/core" | ||
onload="onPayPalLoaded()" | ||
></script> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
While you're at it, would it be helpful to have these as
pre-commit
hooks as well?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.
I like the idea of adding them as precommit hooks too. Let's do that in a separate PR.