Skip to content

Commit

Permalink
Upgrade CI to store binary artifact. (#284)
Browse files Browse the repository at this point in the history
* Add store_artifacts CI step.

* Switch node image to lts.

* Switch to explicit node installation.

* Install sudo etc.

* Add -y flag to apt-get.

* Add curl to init script.

* Use node 10 instead.

* Fix yaml

* Fix nodejs npm conflict.

* Remove echos in CI. [ci skip]

* Fix time test.
  • Loading branch information
jnaviask authored Jan 25, 2021
1 parent cf01953 commit 79212d5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
16 changes: 14 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@ version: 2
jobs:
build:
docker:
- image: cimg/node:15.4.0
- image: ubuntu:18.04
environment:
DEBUG_BUILD: true
DEBIAN_FRONTEND: noninteractive

working_directory: ~/edgeware

steps:
# basic image config to install sudo, node, yarn
- run: apt-get update
- run: apt-get install -y sudo git curl
- run: curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
- run: sudo apt-get install -y nodejs
- run: npm install --global yarn

# begin using repo-specific scripts
- checkout
- run: sudo apt-get update
- run: ~/edgeware/scripts/init.sh

# get cached edgeware build
Expand All @@ -24,6 +31,11 @@ jobs:
# full build
- run: source ~/.cargo/env && cd ~/edgeware && cargo build --release

# save the built binary
- store_artifacts:
path: ~/edgeware/target/release/edgeware
destination: edgeware-node

# save edgeware build
- save_cache:
key: edgeware-{{ checksum "Cargo.lock" }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ mainnet-state.json
db
node_modules
forker-data
beresheet-state.json
beresheet-state.json
build
2 changes: 1 addition & 1 deletion scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
SUDO_PREFIX='sudo'
fi
$SUDO_PREFIX apt update
$SUDO_PREFIX apt install -y build-essential cmake pkg-config libssl-dev openssl git clang libclang-dev
$SUDO_PREFIX apt install -y curl build-essential cmake pkg-config libssl-dev openssl git clang libclang-dev
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Found macbook"
brew install cmake pkg-config openssl git llvm
Expand Down
2 changes: 1 addition & 1 deletion ts-tests/frontier-tester/tests/testTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function timeout(ms) {
}

function blockTimeifyDate(n) {
return Math.floor(n / 1000);
return Math.floor(n / BLOCK_TIME_MS) * (BLOCK_TIME_MS / 1000);
}

describeWithEdgeware("TimeContract test", async (context) => {
Expand Down

0 comments on commit 79212d5

Please sign in to comment.