Skip to content
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

feat: test and verify package on build #1047

Merged
merged 12 commits into from
Nov 15, 2023
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bruuuuuuuce maybe think about in follow up pr or issue be good to maybe try running example or run some test also make sure can actually start up? At least making sure builds for now is better then nothing here.

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.

Loading