Skip to content

Commit

Permalink
Fix solc-nightly job (#1732)
Browse files Browse the repository at this point in the history
* update truffle to 5.0.14

* fix setup to test with solc-nightly

* switch to npx in script/test.sh

* please the linter

* rename build to prepack

* move download of nightly build to a compile script

* make compile script executable
  • Loading branch information
frangio authored and nventuro committed May 2, 2019
1 parent af55a84 commit 9646cc9
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 127 deletions.
115 changes: 6 additions & 109 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"test/behaviors"
],
"scripts": {
"build": "scripts/build.sh",
"compile": "truffle compile",
"compile": "scripts/compile.sh",
"console": "truffle console",
"coverage": "scripts/coverage.sh",
"docsite": "scripts/docsite.sh",
Expand All @@ -19,7 +18,7 @@
"lint:js": "eslint .",
"lint:js:fix": "eslint . --fix",
"lint:sol": "solhint --max-warnings 0 \"contracts/**/*.sol\"",
"prepack": "npm run build",
"prepack": "npm run prepack",
"release": "scripts/release/release.sh",
"version": "scripts/release/update-changelog-release-date.js && scripts/release/update-ethpm-version.js",
"test": "npm run compile && scripts/test.sh"
Expand Down Expand Up @@ -60,6 +59,6 @@
"solhint": "^1.5.0",
"solidity-coverage": "github:rotcivegaf/solidity-coverage#5875f5b7bc74d447f3312c9c0e9fc7814b482477",
"solidity-docgen": "^0.2.0-alpha.0",
"truffle": "^5.0.0"
"truffle": "^5.0.14"
}
}
7 changes: 7 additions & 0 deletions scripts/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

if [ "$SOLC_NIGHTLY" = true ]; then
docker pull ethereum/solc:nightly
fi

truffle compile
File renamed without changes.
17 changes: 6 additions & 11 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ start_ganache() {
)

if [ "$SOLIDITY_COVERAGE" = true ]; then
node_modules/.bin/ganache-cli-coverage --emitFreeLogs true --allowUnlimitedContractSize true --gasLimit 0xfffffffffff --port "$ganache_port" "${accounts[@]}" > /dev/null &
npx ganache-cli-coverage --emitFreeLogs true --allowUnlimitedContractSize true --gasLimit 0xfffffffffff --port "$ganache_port" "${accounts[@]}" > /dev/null &
else
node_modules/.bin/ganache-cli --gasLimit 0xfffffffffff --port "$ganache_port" "${accounts[@]}" > /dev/null &
npx ganache-cli --gasLimit 0xfffffffffff --port "$ganache_port" "${accounts[@]}" > /dev/null &
fi

ganache_pid=$!
Expand All @@ -62,19 +62,14 @@ else
start_ganache
fi

if [ "$SOLC_NIGHTLY" = true ]; then
echo "Downloading solc nightly"
wget -q https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/soljson-nightly.js -O /tmp/soljson.js && find . -name soljson.js -exec cp /tmp/soljson.js {} \;
fi

truffle version
npx truffle version

if [ "$SOLIDITY_COVERAGE" = true ]; then
node_modules/.bin/solidity-coverage
npx solidity-coverage

if [ "$CONTINUOUS_INTEGRATION" = true ]; then
cat coverage/lcov.info | node_modules/.bin/coveralls
cat coverage/lcov.info | npx coveralls
fi
else
node_modules/.bin/truffle test "$@"
npx truffle test "$@"
fi
15 changes: 12 additions & 3 deletions truffle-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
require('chai/register-should');

const solcStable = {
version: '0.5.7',
};

const solcNightly = {
version: 'nightly',
docker: true,
};

const useSolcNightly = process.env.SOLC_NIGHTLY === 'true';

module.exports = {
networks: {
development: {
Expand All @@ -17,8 +28,6 @@ module.exports = {
},

compilers: {
solc: {
version: '0.5.7',
},
solc: useSolcNightly ? solcNightly : solcStable,
},
};

0 comments on commit 9646cc9

Please sign in to comment.