-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: verify against multiple versions of node
- Loading branch information
Showing
13 changed files
with
237 additions
and
2,223 deletions.
There are no files selected for viewing
This file contains 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 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,72 @@ | ||
name: 'Verify' | ||
description: 'Verifies the current branch' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: npm install --force | ||
shell: bash | ||
|
||
- run: npm run lint:cli | ||
shell: bash | ||
|
||
- run: npm run build | ||
shell: bash | ||
|
||
- run: npm run test | ||
shell: bash | ||
|
||
- name: cache the dist directory | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ./dist/apps/cli | ||
key: hdcli-dist-${{ github.run_id }} | ||
|
||
- name: package for local testing | ||
shell: bash | ||
working-directory: ./dist/apps/cli | ||
run: | | ||
npm version 0.0.0-local --no-git-tag-version | ||
npm pack | ||
- name: cache the tarball | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ./dist/apps/cli/herodevs-cli-0.0.0-local.tgz | ||
key: hdcli-tarball-${{ github.run_id }} | ||
|
||
- name: install CLI dependencies | ||
run: npm install | ||
working-directory: ./dist/apps/cli | ||
shell: bash | ||
|
||
- name: create commonjs bundle using esbuild | ||
run: npx -y esbuild src/main.js --bundle --platform=node --outfile=sea.cjs --minify | ||
working-directory: ./dist/apps/cli | ||
shell: bash | ||
|
||
- name: create blob for sea | ||
run: node --experimental-sea-config ./sea-config.json | ||
working-directory: ./dist/apps/cli | ||
shell: bash | ||
|
||
- name: copy node to use to create sea | ||
run: cp $(command -v node) hdcli | ||
working-directory: ./dist/apps/cli | ||
shell: bash | ||
|
||
- name: inject the CLI sea into the copied node | ||
run: npx postject hdcli NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 | ||
working-directory: ./dist/apps/cli | ||
shell: bash | ||
|
||
- name: cache the sea | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ./dist/apps/cli/hdcli | ||
key: hdcli-sea-${{ github.run_id }} |
This file was deleted.
Oops, something went wrong.
This file contains 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 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,79 @@ | ||
name: Runtime Tests | ||
on: | ||
workflow_call: | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
via-npx: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: ['14', '16', '18', '20', '22'] | ||
name: node ${{ matrix.node }} | ||
|
||
steps: | ||
- name: uncache the tarball | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ./dist/apps/cli/herodevs-cli-0.0.0-local.tgz | ||
key: hdcli-tarball-${{ github.run_id }} | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- run: npm init -y | ||
|
||
- name: setup local git repo | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github CI" | ||
git init | ||
echo "test" > test.txt | ||
git add . | ||
git commit -m "test commit" | ||
echo "test 2" > test.txt | ||
git add . | ||
git commit -m "test commit 2" | ||
- run: npm install ./dist/apps/cli/herodevs-cli-0.0.0-local.tgz | ||
|
||
- run: npx @herodevs/cli --version | ||
|
||
- run: npx @herodevs/cli report committers | ||
|
||
via-sea: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: ['10', '12'] | ||
name: node ${{ matrix.node }} | ||
|
||
steps: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: uncache build output | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ./dist/apps/cli/hdcli | ||
key: hdcli-sea-${{ github.run_id }} | ||
|
||
- name: setup local git repo | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github CI" | ||
git init | ||
echo "test" > test.txt | ||
git add . | ||
git commit -m "test commit" | ||
echo "test 2" > test.txt | ||
git add . | ||
git commit -m "test commit 2" | ||
- name: run the cli | ||
run: ./dist/apps/cli/hdcli report committers |
This file contains 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 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 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 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,5 @@ | ||
{ | ||
"main": "sea.cjs", | ||
"output": "sea-prep.blob", | ||
"disableExperimentalSEAWarning": true | ||
} |
This file contains 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.