-
Notifications
You must be signed in to change notification settings - Fork 123
Add CI workflow for testing and building Node.js application1 #64
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
Open
longjason529
wants to merge
6
commits into
Acode-Foundation:main
Choose a base branch
from
longjason529:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
14da1aa
first commit
e532642
Add Node.js CI workflow for testing and building
longjason529 1a75efb
Setup GitHub Pages automation for magmod.app
26eaed3
Setup GitHub Pages with CI/CD automation
c45569f
Setup GitHub Pages automation with gh-pages integration
88ee830
Resolve merge conflicts
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 @@ | ||
| <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>cmds/pm/pm - platform/frameworks/base - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.css"><link rel="stylesheet" type="text/css" href="/+static/prettify/prettify.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?faa=1&continue=https://android.googlesource.com/login/platform/frameworks/base/%2B/oreo-release/cmds/pm/pm">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">android</a><span class="Breadcrumbs-sep">/</span><a class="Breadcrumbs-crumb" href="/platform/">platform</a><span class="Breadcrumbs-sep">/</span><a class="Breadcrumbs-crumb" href="/platform/frameworks/">frameworks</a><span class="Breadcrumbs-sep">/</span><a class="Breadcrumbs-crumb" href="/platform/frameworks/base/">base</a><span class="Breadcrumbs-sep">/</span><a class="Breadcrumbs-crumb" href="/platform/frameworks/base/+/oreo-release">oreo-release</a><span class="Breadcrumbs-sep">/</span><a class="Breadcrumbs-crumb" href="/platform/frameworks/base/+/oreo-release/">.</a><span class="Breadcrumbs-sep">/</span><a class="Breadcrumbs-crumb" href="/platform/frameworks/base/+/oreo-release/cmds">cmds</a><span class="Breadcrumbs-sep">/</span><a class="Breadcrumbs-crumb" href="/platform/frameworks/base/+/oreo-release/cmds/pm">pm</a><span class="Breadcrumbs-sep">/</span><span class="Breadcrumbs-crumb">pm</span></div><div class="u-sha1 u-monospace BlobSha1">blob: 81838386c055e35958b7b7ff6d9a2e934f05daca [<a href="/platform/frameworks/base/+/oreo-release/cmds/pm/pm">file</a>]</div><table class="FileContents"><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="1"></td><td class="FileContents-lineContents" id="1"><span class="com"># Script to start "pm" on the device, which has a very rudimentary</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="2"></td><td class="FileContents-lineContents" id="2"><span class="com"># shell.</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="3"></td><td class="FileContents-lineContents" id="3"><span class="com">#</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="4"></td><td class="FileContents-lineContents" id="4"><span class="kwd">base</span><span class="pun">=/</span><span class="pln">system</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="5"></td><td class="FileContents-lineContents" id="5"><span class="kwd">export</span><span class="pln"> CLASSPATH</span><span class="pun">=</span><span class="pln">$base</span><span class="pun">/</span><span class="pln">framework</span><span class="pun">/</span><span class="pln">pm</span><span class="pun">.</span><span class="pln">jar</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="6"></td><td class="FileContents-lineContents" id="6"><span class="kwd">exec</span><span class="pln"> app_process $base</span><span class="pun">/</span><span class="pln">bin com</span><span class="pun">.</span><span class="pln">android</span><span class="pun">.</span><span class="pln">commands</span><span class="pun">.</span><span class="pln">pm</span><span class="pun">.</span><span class="typ">Pm</span><span class="pln"> </span><span class="str">"$@"</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="7"></td><td class="FileContents-lineContents" id="7"></td></tr></table><script nonce="ySasJjttWb3GPOQ6vRV0Tw">for (let lineNumEl of document.querySelectorAll('td.u-lineNum')) {lineNumEl.onclick = () => {window.location.hash = `#${lineNumEl.getAttribute('data-line-number')}`;};}</script></div> <!-- Container --></div> <!-- Site-content --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a>| <a href="https://policies.google.com/privacy">Privacy</a>| <a href="https://policies.google.com/terms">Terms</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></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 |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| name: Deploy to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build project | ||
| run: npm run build | ||
|
|
||
| - name: Create dist directory if missing | ||
| run: mkdir -p dist | ||
|
|
||
| - name: Create index.html | ||
| if: hashFiles('dist/index.html') == '' | ||
| run: | | ||
| cat > dist/index.html << 'EOF' | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>MagMod App</title> | ||
| <style> | ||
| body { | ||
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; | ||
| margin: 0; | ||
| padding: 2rem; | ||
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | ||
| min-height: 100vh; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
| .container { | ||
| background: white; | ||
| border-radius: 10px; | ||
| box-shadow: 0 20px 60px rgba(0,0,0,0.3); | ||
| padding: 3rem; | ||
| text-align: center; | ||
| max-width: 600px; | ||
| } | ||
| h1 { color: #333; margin: 0 0 1rem 0; } | ||
| p { color: #666; line-height: 1.6; } | ||
| .badge { display: inline-block; background: #667eea; color: white; padding: 0.5rem 1rem; border-radius: 5px; margin-top: 1rem; font-weight: bold; } | ||
| .links { margin-top: 2rem; } | ||
| .links a { color: #667eea; text-decoration: none; margin: 0 1rem; } | ||
| .links a:hover { text-decoration: underline; } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <h1>🚀 MagMod App</h1> | ||
| <p>Acode Plugin Template for Development</p> | ||
| <p><span class="badge">GitHub Pages Deployed ✓</span></p> | ||
| <div class="links"> | ||
| <a href="https://github.com/longjason529/magmod.app">GitHub Repository</a> | ||
| <a href="https://acode.app">Acode Editor</a> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </html> | ||
| EOF | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v2 | ||
| with: | ||
| path: 'dist' | ||
|
|
||
| deploy: | ||
| name: Deploy | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
|
|
||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v2 |
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,31 @@ | ||
| # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
|
||
| name: Node.js CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [18.x, 20.x, 22.x] | ||
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: 'npm' | ||
| - run: npm ci | ||
| - run: npm run build --if-present | ||
| - run: npm test | ||
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,40 @@ | ||
| # Workspace CI workflow - Independent workspace testing and builds | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
|
||
| name: Workspace CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main", "feature/workspace-setup" ] | ||
| pull_request: | ||
| branches: [ "main", "feature/workspace-setup" ] | ||
|
|
||
| jobs: | ||
| workspace: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [18.x, 20.x] | ||
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: 'npm' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Run linting | ||
| run: npm run lint --if-present | ||
| - name: Build workspace | ||
| run: npm run build --if-present | ||
| - name: Run workspace tests | ||
| run: npm test | ||
| - name: Generate coverage reports | ||
| run: npm run coverage --if-present | ||
| - name: Setup workspace environment | ||
| run: npm run setup --if-present |
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 @@ | ||
| # magmod.app |
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,19 @@ | ||
| # GitHub Pages Setup for MagMod App | ||
|
|
||
| **Repository:** https://github.com/longjason529/magmod.app | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### Option 1: Automated Setup (Recommended) | ||
|
|
||
| ```bash | ||
| # Make the setup script executable | ||
| chmod +x scripts/setup-gh-pages.sh | ||
|
|
||
| # Run the setup | ||
| ./scripts/setup-gh-pages.sh | ||
|
|
||
| # Commit and push | ||
| git add . | ||
| git commit -m "Setup GitHub Pages automation" | ||
| git push origin main |
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,30 @@ | ||
| )]}' | ||
| { | ||
| "id": "49c721f0fda7379d1c0d09fb8c669fd150580efb", | ||
| "entries": [ | ||
| { | ||
| "mode": 33188, | ||
| "type": "blob", | ||
| "id": "4868555b340bd417b4a8d28d6b92590572aa11b9", | ||
| "name": "Android.mk" | ||
| }, | ||
| { | ||
| "mode": 33188, | ||
| "type": "blob", | ||
| "id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", | ||
| "name": "MODULE_LICENSE_APACHE2" | ||
| }, | ||
| { | ||
| "mode": 33188, | ||
| "type": "blob", | ||
| "id": "c5b1efa7aac764ae6d8da63476a2d5cec02a6a5d", | ||
| "name": "NOTICE" | ||
| }, | ||
| { | ||
| "mode": 33188, | ||
| "type": "blob", | ||
| "id": "48d5d4aed7a711b61bcc3eaae1597354fc9e7804", | ||
| "name": "cmd.cpp" | ||
| } | ||
| ] | ||
| } |
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.
npm teststep will fail with exit code 1 if notestscript is defined inpackage.json(npm's default behaviour isecho "Error: no test specified" && exit 1). The immediately preceding build step already uses--if-presentfor exactly this reason, but the test step does not. For a new repository that has no tests yet, every CI run will fail at this step.