Skip to content

Open source PPaaS Scripting #17

Open source PPaaS Scripting

Open source PPaaS Scripting #17

Workflow file for this run

on:
pull_request:
paths:
- './package.json'
- './package-lock.json'
- 'common/**.js*'
- 'common/**.ts*'
- 'common/**/package.json'
- 'agent/**.js*'
- 'agent/**.ts*'
- 'agent/**/package.json'
- 'controller/**.html'
- 'controller/**.js*'
- 'controller/**.ts*'
- 'controller/**/package.json'
name: Pull Request PPaaS
jobs:
test-release:
name: Build project
strategy:
matrix:
node-version: [18.x, 20.x]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: stable
override: true
- name: Add Node.js toolchain ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Build Webassemblies ${{ matrix.node-version }}
run: |
set -x
# install mdbook and wasm-pack
mkdir ~/bin
PATH=$PATH:~/bin
curl -sSL https://github.com/rustwasm/wasm-pack/releases/download/v0.12.1/wasm-pack-v0.12.1-x86_64-unknown-linux-musl.tar.gz \
| tar -xz --strip-components=1 -C ~/bin --no-anchored wasm-pack
# setup some envs to various paths for convenience
PROJECT_ROOT=$PWD
CONTROLLER_DIR=$(realpath $PROJECT_ROOT/controller)
CONFIG_WASM_LIB_DIR=$(realpath $PROJECT_ROOT/lib/config-wasm)
HDR_WASM_LIB_DIR=$(realpath $PROJECT_ROOT/lib/hdr-histogram-wasm)
HDR_WASM_OUTPUT_REACT_DIR=$CONTROLLER_DIR/lib/hdr-histogram-wasm
# build the hdr-histogram-wasm for the results viewer
cd $HDR_WASM_LIB_DIR
wasm-pack build --release -t bundler -d $HDR_WASM_OUTPUT_REACT_DIR --scope fs
# build the config-wasm for the yaml parser
cd $CONFIG_WASM_LIB_DIR
wasm-pack build --release -t nodejs --scope fs
- name: Install NPM Dependencies
run: npm ci
- name: Run Lint
run: npm run linterror
- name: Build Controller
env:
# Minimum variables needed to compile
PEWPEWCONTROLLER_UNITTESTS_S3_BUCKET_NAME: "unit-test-bucket"
PEWPEWCONTROLLER_UNITTESTS_S3_BUCKET_URL: "https://unit-test-bucket.s3.amazonaws.com"
PEWPEWCONTROLLER_UNITTESTS_S3_KEYSPACE_PREFIX: "unittests/"
PEWPEWCONTROLLER_UNITTESTS_S3_REGION_ENDPOINT: "s3-us-east-1.amazonaws.com"
APPLICATION_NAME: pewpewcontroller
AGENT_ENV: "unittests"
AGENT_DESC: "c5n.large"
PEWPEWAGENT_UNITTESTS_SQS_SCALE_OUT_QUEUE_URL: "https://sqs.us-east-1.amazonaws.com/unittests/sqs-scale-out"
PEWPEWAGENT_UNITTESTS_SQS_SCALE_IN_QUEUE_URL: "https://sqs.us-east-1.amazonaws.com/unittests/sqs-scale-in"
PEWPEWCONTROLLER_UNITTESTS_SQS_COMMUNICATION_QUEUE_URL: "https://sqs.us-east-1.amazonaws.com/unittests/sqs-communication"
run: npm run build:react
- name: Run Tests
run: NODE_ENV=test npm test