149 lines
4.1 KiB
YAML
149 lines
4.1 KiB
YAML
version: 2.1
|
|
|
|
executors:
|
|
machine_executor:
|
|
machine: true
|
|
working_directory: ~/repo
|
|
|
|
commands:
|
|
build-and-test:
|
|
parameters:
|
|
node-version:
|
|
type: string
|
|
default: "10.16.3"
|
|
test-script:
|
|
type: string
|
|
default: "test-node"
|
|
upgrade-chrome:
|
|
type: string
|
|
default: ""
|
|
|
|
steps:
|
|
- checkout
|
|
|
|
- when:
|
|
condition: << parameters.upgrade-chrome >>
|
|
steps:
|
|
- run:
|
|
name: Upgrade chrome
|
|
command: |
|
|
sudo apt-get purge chromium-browser
|
|
sudo apt-get update
|
|
sudo apt-get install -y libappindicator1 fonts-liberation
|
|
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
sudo dpkg -i google-chrome*.deb
|
|
google-chrome --version
|
|
|
|
- run:
|
|
name: Update gcc version
|
|
command: |
|
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
|
sudo apt update
|
|
sudo apt install gcc-6
|
|
sudo apt install g++-6
|
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
|
|
|
|
- run:
|
|
name: Prepare to run parity
|
|
command: |
|
|
mkdir -p /tmp/parity/keys
|
|
cp -r admin/test-parity/parity-keys /tmp/parity/keys/DevelopmentChain
|
|
cp admin/test-parity/parity-dev.* /tmp/parity
|
|
chmod -R 777 /tmp/parity
|
|
ls -la /tmp/parity
|
|
|
|
- run:
|
|
name: Starting Parity
|
|
command: |
|
|
docker run -d \
|
|
-p 8545:8545 \
|
|
-p 8546:8546 \
|
|
-p 30303:30303 \
|
|
-p 30303:30303/udp \
|
|
--name parity \
|
|
-v /tmp/parity:/home/parity/.local/share/io.parity.ethereum parity/parity:v2.4.8-stable \
|
|
--chain /home/parity/.local/share/io.parity.ethereum/parity-dev.json \
|
|
--unlock=0x7454a8F5a7c7555d79B172C89D20E1f4e4CC226C \
|
|
--password /home/parity/.local/share/io.parity.ethereum/parity-dev.pwds \
|
|
--min-gas-price 1000000000 \
|
|
--jsonrpc-interface all
|
|
|
|
- run:
|
|
name: Waiting for Parity to be ready
|
|
command: |
|
|
for i in `seq 1 20`;
|
|
do
|
|
nc -z localhost 8545 && echo Success && exit 0
|
|
echo -n .
|
|
sleep 2
|
|
done
|
|
docker ps -a
|
|
docker logs parity
|
|
echo Failed waiting for Parity && exit 1
|
|
|
|
- run:
|
|
name: Run << parameters.test-script >> with node version << parameters.node-version >>
|
|
command: |
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
|
nvm install << parameters.node-version >>
|
|
node -v
|
|
npm -v
|
|
gcc --version
|
|
npm ci
|
|
npm run bootstrap
|
|
npm run << parameters.test-script >>
|
|
|
|
jobs:
|
|
node-v8:
|
|
description: "test with node version 8"
|
|
executor: machine_executor
|
|
steps:
|
|
- build-and-test:
|
|
node-version: "8.16.1"
|
|
test-script: "test-node"
|
|
|
|
node-v10:
|
|
description: "test with node version 10"
|
|
executor: machine_executor
|
|
steps:
|
|
- build-and-test:
|
|
node-version: "10.16.3"
|
|
test-script: "test-node"
|
|
|
|
node-v12:
|
|
description: "test with node version 12"
|
|
executor: machine_executor
|
|
steps:
|
|
- build-and-test:
|
|
node-version: "12.13.1"
|
|
test-script: "test-node"
|
|
|
|
browser-esm:
|
|
description: "test browser with es6 module"
|
|
executor: machine_executor
|
|
steps:
|
|
- build-and-test:
|
|
node-version: "12.13.1"
|
|
test-script: "test-browser-esm"
|
|
upgrade-chrome: "true"
|
|
|
|
browser-umd:
|
|
description: "test browser with es3 module"
|
|
executor: machine_executor
|
|
steps:
|
|
- build-and-test:
|
|
node-version: "12.13.1"
|
|
test-script: "test-browser-umd"
|
|
|
|
|
|
workflows:
|
|
version: 2
|
|
all:
|
|
jobs:
|
|
- node-v8
|
|
- node-v10
|
|
- node-v12
|
|
- browser-esm
|
|
- browser-umd
|