-
Notifications
You must be signed in to change notification settings - Fork 9
Refactor: Improve Build Workflow #576
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 4 commits
e4b7670
d4813d7
e538915
7c2f15e
e932b86
ebeb8d2
3a2c767
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,41 +1,78 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Lint & Build | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Lint & Build & Compare package sizes | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # zizmor: ignore[dangerous-triggers] - Mitigated by checking repository origin | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request_target: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [labeled, opened, synchronize, reopened] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| group: ${{ github.head_ref || github.ref_name }}-build-test-scan | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||||||||||||||||||||||||||||
| group: ${{ github.head_ref || github.ref_name }}-lint-build-test | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+15
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. Missing The Proposed fixAdd permissions to the build-and-test-job:
runs-on: ubuntu-latest
name: Lint & Build & Compare package sizes
+ permissions:
+ contents: read
+ pull-requests: write
if: |🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| build-and-test: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Lint & Build | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Node | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-node@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version-file: .nvmrc | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cache: 'yarn' | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn && yarn install:all | ||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| NODE_OPTIONS: '--max-old-space-size=4096' | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn run lint | ||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| NODE_OPTIONS: '--max-old-space-size=4096' | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn run build | ||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| NODE_OPTIONS: '--max-old-space-size=4096' | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Job 1: Post instruction comment for external PRs | ||||||||||||||||||||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| comment-external-pr: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| github.event.pull_request.head.repo.full_name != github.repository && | ||||||||||||||||||||||||||||||||||||||||||||||||||
| github.event.action == 'opened' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Comment on external PR | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| issue-number: ${{ github.event.pull_request.number }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| body: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ## 👋 Thanks for your contribution! | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Since this PR comes from a forked repository, the lint and build will only run for internal PRs for security reasons. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Please ensure that your PR is coming from a meaningful branch name. Eg. feature/my-feature **not main** | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| **Next steps:** | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. A maintainer will review your code | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. If approved, they'll add the `safe-to-build` label to trigger build and test | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. **After each new commit**, the maintainer will need to remove and re-add the label for security | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Thank you for your patience! 🙏 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+32
to
+43
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. Inconsistent indentation in comment body will render poorly. Lines 38-42 have extra leading spaces that will cause them to render as a code block in Markdown, breaking the visual consistency of the comment. Proposed fix body: |
## 👋 Thanks for your contribution!
Since this PR comes from a forked repository, the lint and build will only run for internal PRs for security reasons.
Please ensure that your PR is coming from a meaningful branch name. Eg. feature/my-feature **not main**
- **Next steps:**
- 1. A maintainer will review your code
- 2. If approved, they'll add the `safe-to-build` label to trigger build and test
- 3. **After each new commit**, the maintainer will need to remove and re-add the label for security
+ **Next steps:**
+ 1. A maintainer will review your code
+ 2. If approved, they'll add the `safe-to-build` label to trigger build and test
+ 3. **After each new commit**, the maintainer will need to remove and re-add the label for security
Thank you for your patience! 🙏📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Job 2: Build, Lint and Compare package sizes | ||||||||||||||||||||||||||||||||||||||||||||||||||
| build-and-test-job: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Lint & Build & Compare package sizes | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| (github.event.label.name == 'safe-to-build') || | ||||||||||||||||||||||||||||||||||||||||||||||||||
| (github.event.pull_request.head.repo.full_name == github.repository) && github.event.pull_request.head.ref != 'main' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||
victorkl400 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: ${{ github.event.pull_request.head.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Node | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version-file: .nvmrc | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cache: yarn | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn && yarn install:all | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn build | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Compare package sizes | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: preactjs/compressed-size-action@946a292cd35bd1088e0d7eb92b69d1a8d5b5d76a # v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
victorkl400 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pattern: "packages/vechain-kit/dist/**/*" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| exclude: "{**/node_modules/**}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| compression: none | ||||||||||||||||||||||||||||||||||||||||||||||||||
| minimum-change-threshold: 1000 | ||||||||||||||||||||||||||||||||||||||||||||||||||
victorkl400 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn lint | ||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.