Skip to content

Basic integration tests #59

Basic integration tests

Basic integration tests #59

Workflow file for this run

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: First set up src
shell: bash
working-directory: src
run: npm ci --workspaces --omit=optional
- name: Check for changes in tree
shell: bash
run: git status
- name: Try to find the 165 dependency
shell: bash
run: find . -name package.json | xargs fgrep '.165'
- name: Install Dependencies in pkgs/install
shell: bash
working-directory: pkgs/install
run: npm ci --verbose
- name: Install Dependencies in pkgs/load
shell: bash
working-directory: pkgs/load
run: npm ci --verbose
- name: Install Dependencies in pkgs/cli
shell: bash
working-directory: pkgs/cli
run: npm ci --verbose
- name: Install Dependencies in pkgs/cargo-messages
shell: bash
working-directory: pkgs/cargo-messages
run: npm ci --verbose
- 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
ls -alF
# - name: Start npm Proxy
# shell: bash
# run: ./proxy.sh
# working-directory: ./test/integration/proxy
# - name: Publish @cargo-messages/linux-x64-gnu to proxy
# shell: bash
# working-directory: ./pkgs/cargo-messages/npm/linux-x64-gnu
# 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}}