Basic integration tests #61
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://localhost: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: | | |
echo "Checking that all bundled tools are up to date..." | |
dirty_workspaces=() | |
for input_workspace in `find src -type d -mindepth 1 -maxdepth 1 -not -name node_modules` ; do | |
output_workspace=$(echo $input_workspace | sed -e 's/^src/pkgs/') | |
input_mtime=$(git log -1 --format=%ct $input_workspace) | |
output_mtime=$(git log -1 --format=%ct $output_workspace) | |
if [[ $input_mtime -gt $output_mtime ]] ; then | |
echo "❌ $input_workspace has changed since $output_workspace was last generated" | |
dirty_workspaces+=($input_workspace) | |
fi | |
done | |
if [[ ${#dirty_workspaces[@]} -gt 0 ]] ; then | |
echo | |
echo '💡 Re-run `npm run bundle` on the following workspaces before committing:' | |
for workspace in ${dirty_workspaces[*]} ; do | |
echo " • $workspace" | |
done | |
exit 1 | |
fi | |
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: Diagnostics | |
shell: bash | |
run: | | |
cd ./pkgs/cargo-messages/dist | |
ls -alF | |
- name: Start npm Proxy | |
shell: bash | |
run: ./proxy.sh | |
working-directory: ./test/integration/proxy | |
- name: Determine tarball | |
shell: bash | |
working-directory: ./pkgs/cargo-messages/dist | |
run: | | |
echo "cargo-messages-linux-x64-gnu-$(jq -r '.version' < ../package.json).tgz" | |
ls -l "cargo-messages-linux-x64-gnu-$(jq -r '.version' < ../package.json).tgz" | |
# - name: Publish @cargo-messages/linux-x64-gnu to proxy | |
# shell: bash | |
# working-directory: ./pkgs/cargo-messages/dist | |
# run: | | |
# npx npm-cli-adduser -u ${{env.CIUSER}} -p ${{env.CIPASS}} -e ${{env.CIEMAIL}} -r ${{env.PROXY}} | |
# npm publish --registry ${{env.PROXY}} | |
# - name: Publish cargo-messages to proxy | |
# shell: bash | |
# working-directory: ./pkgs/cargo-messages | |
# run: | | |
# npx npm-cli-adduser -u ${{env.CIUSER}} -p ${{env.CIPASS}} -e ${{env.CIEMAIL}} -r ${{env.PROXY}} | |
# npm publish --registry ${{env.PROXY}} | |
# - name: Publish @neon-rs/load to proxy | |
# shell: bash | |
# working-directory: ./pkgs/load | |
# run: | | |
# npx npm-cli-adduser -u ${{env.CIUSER}} -p ${{env.CIPASS}} -e ${{env.CIEMAIL}} -r ${{env.PROXY}} | |
# npm publish --registry ${{env.PROXY}} | |
# - name: Publish @neon-rs/cli to proxy | |
# shell: bash | |
# working-directory: ./pkgs/cli | |
# run: | | |
# npx npm-cli-adduser -u ${{env.CIUSER}} -p ${{env.CIPASS}} -e ${{env.CIEMAIL}} -r ${{env.PROXY}} | |
# npm publish --registry ${{env.PROXY}} | |