Skip to content

Commit

Permalink
feat: test and verify package on build (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruuuuuuuce authored Nov 15, 2023
1 parent 66df91d commit 5c0e196
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 12 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,68 @@ jobs:
if: ${{ steps.validation.outcome == 'failure' }}
run: exit 1

verify-packages:
strategy:
matrix:
node: [ 18 ]
fail-fast: true
max-parallel: 1
name: Verify packages are installable on node ${{ matrix.node }}
runs-on: ubuntu-latest

steps:
- name: Setup repo
uses: actions/checkout@v3

- name: Build all packages
run: |
pushd packages/core
npm install
npm run build
npm pack
popd
pushd packages/common-integration-tests
npm install
npm run build
npm pack
popd
pushd packages/client-sdk-nodejs
npm install
npm run build
npm pack
popd
pushd packages/client-sdk-web
npm install
npm run build
npm pack
popd
- name: Locally install in nodejs example and verify it builds
run: |
pushd examples/nodejs/cache
# This is a bit of a hack, but ensures that the package-lock does not get corrupted
# due to installing these locally packaged files. All we care about is that the examples
# use the locally packaged sdks, and that they can build correctly with no errors
rm -rf node_modules package-lock.json
npm i ../../../packages/core/gomomento-sdk-core-0.0.1.tgz
rm -rf node_modules package-lock.json
npm i ../../../packages/client-sdk-nodejs/gomomento-sdk-0.0.1.tgz
rm -rf node_modules package-lock.json
npm i
npm run build
popd
- name: Locally install in web example and verify it builds
run: |
pushd examples/web/cache
rm -rf node_modules package-lock.json
npm i ../../../packages/core/gomomento-sdk-core-0.0.1.tgz
rm -rf node_modules package-lock.json
npm i ../../../packages/client-sdk-web/gomomento-sdk-web-0.0.1.tgz
rm -rf node_modules package-lock.json
npm i
npm run build
popd
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
# dependabot-auto-merge:
# name: Dependabot Auto Merge
Expand Down
22 changes: 10 additions & 12 deletions packages/client-sdk-nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c0e196

Please sign in to comment.