Basic integration tests #151
Workflow file for this run
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
name: CI | |
env: | |
NODE_VERSION: 18.x | |
PROXY: http://127.0.0.1:4873/ | |
CIUSER: ci | |
CIEMAIL: [email protected] | |
CIPASS: dummycipassword | |
on: | |
push: | |
# Prevent duplicate runs of this workflow on our own internal PRs. | |
branches: | |
- main | |
- next/* | |
pull_request: | |
types: [opened, synchronize, reopened, labeled] | |
branches: | |
- main | |
- next/* | |
jobs: | |
bundles: | |
name: Check Bundles | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check Bundles | |
shell: bash | |
run: ./test/lint/check-bundles.sh | |
integration: | |
name: Integration Tests | |
needs: [bundles] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Dependencies | |
shell: bash | |
run: npm ci --verbose | |
- name: Build | |
uses: neon-actions/[email protected] | |
with: | |
working-directory: ./pkgs/cargo-messages | |
target: linux-x64-gnu | |
node-version: ${{ env.NODE_VERSION }} | |
use-cross: false | |
npm-publish: false | |
github-release: false | |
- name: Start npm Proxy | |
shell: bash | |
working-directory: ./test/integration/proxy | |
timeout-minutes: 3 | |
run: ./proxy.sh '${{ env.PROXY }}' | |
- name: Authenticate Proxy | |
shell: bash | |
run: npx npm-cli-adduser -u ${{env.CIUSER}} -p ${{env.CIPASS}} -e ${{env.CIEMAIL}} -r ${{env.PROXY}} | |
- name: Publish @cargo-messages/linux-x64-gnu to proxy | |
shell: bash | |
run: npm publish ./pkgs/cargo-messages/dist/"cargo-messages-linux-x64-gnu-$(jq -r '.version' < ./pkgs/cargo-messages/package.json).tgz" --registry ${{env.PROXY}} | |
- name: Publish cargo-messages to proxy | |
shell: bash | |
working-directory: ./pkgs/cargo-messages | |
run: npm publish --registry ${{env.PROXY}} | |
- name: Publish @neon-rs/load to proxy | |
shell: bash | |
working-directory: ./pkgs/load | |
run: npm publish --registry ${{env.PROXY}} | |
- name: Publish @neon-rs/cli to proxy | |
shell: bash | |
working-directory: ./pkgs/cli | |
run: npm publish --registry ${{env.PROXY}} | |
- name: Install Dependencies for sniff-bytes Integration Test | |
shell: bash | |
working-directory: ./test/integration/sniff-bytes | |
run: | | |
npm ci | |
cat package-lock.json | |
- name: Build sniff-bytes Integration Test | |
uses: neon-actions/[email protected] | |
with: | |
working-directory: ./test/integration/sniff-bytes | |
target: linux-x64-gnu | |
node-version: ${{ env.NODE_VERSION }} | |
use-cross: false | |
npm-publish: false | |
github-release: false | |
- name: Display the integrity shasum of @sniff-bytes/linux-x64-gnu | |
shell: bash | |
run: cat ./test/integration/sniff-bytes/dist/sniff-bytes-linux-x64-gnu-1.0.0.tgz | shasum -a 512 | |
- name: Publish @sniff-bytes/linux-x64-gnu to proxy | |
shell: bash | |
run: npm publish ./test/integration/sniff-bytes/dist/sniff-bytes-linux-x64-gnu-1.0.0.tgz --registry ${{ env.PROXY }} || (cat test/integration/proxy/proxy.log && exit 1) | |
- name: Display the integrity shasum of @sniff-bytes/linux-x64-gnu | |
shell: bash | |
run: | | |
cat ./test/integration/sniff-bytes/dist/sniff-bytes-linux-x64-gnu-1.0.0.tgz | shasum -a 512 | |
npm view cargo-messages dist.integrity --registry ${{env.PROXY}} | |
npm view @sniff-bytes/linux-x64-gnu dist.integrity --registry ${{env.PROXY}} | |
# curl -s ${{env.PROXY}}/@sniff-bytes/linux-x64-gnu | jq -r '.versions[.["dist-tags"].latest].dist.integrity' | |
- name: Publish sniff-bytes to proxy | |
shell: bash | |
working-directory: test/integration/sniff-bytes | |
run: npm publish --registry ${{ env.PROXY }} | |
- name: Run test-sniff-bytes tests | |
shell: bash | |
working-directory: test/integration/test-sniff-bytes | |
run: | | |
# Since package integrity checksums may vary depending on what versions | |
# are available in the proxy registry, we don't put the lockfile for this | |
# test in source control. This means we have to use `npm i`, not `npm ci`. | |
npm i --registry ${{ env.PROXY }} || (cat ../proxy/proxy.log && exit 1) | |
npm test |