-
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.
chore: add workflow that tests if tarball is installable
- Loading branch information
1 parent
d49ee2d
commit 697d946
Showing
2 changed files
with
39 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: NPM pack check | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
npm-pack-check: | ||
runs-on: ubuntu-latest | ||
# Only run this job if the PR is from a trusted collaborator (i.e. not a fork) | ||
if: github.event.pull_request.head.repo.full_name == github.repository | ||
steps: | ||
# Checkout project repository | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
# Setup Node.js environment | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
registry-url: https://registry.npmjs.org/ | ||
node-version: 20 | ||
|
||
# Use a cache for dependencies | ||
- uses: actions/[email protected] | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} | ||
|
||
# Install dependencies so that prepublish scripts work as expected | ||
- name: Install deps | ||
run: npm i | ||
|
||
- name: Ensure pack file can be installed | ||
run: | | ||
mkdir ../test-install | ||
npm pack --json | jq -r '.[] | .filename' | xargs -I {} npm install ../test-install/{} --no-save | ||
cd ../test-install | ||
node -e "const yates = require('@cerebruminc/yates'); if (typeof yates.setup === 'undefined') { throw new Error('setup export is undefined'); }" |
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
registry-url: https://registry.npmjs.org/ | ||
node-version: 16 | ||
node-version: 20 | ||
|
||
# Use a cache for dependencies | ||
- uses: actions/[email protected] | ||
|