Skip to content

Commit

Permalink
feat(buildkite): added initial core-contracts CI setup (#159)
Browse files Browse the repository at this point in the history
* feat(buildkite): added initial core-contracts CI setup

* Remove contracts that will surely fail CI tests

* rustup default version to buidlkite pipeline and wasm32-unknown-unknown

Co-authored-by: Olga Telezhnaya <olyatelezhnaya@gmail.com>
  • Loading branch information
chefsale and telezhnaya authored Jul 12, 2021
1 parent 07cc25a commit 2ad85f3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- label: "check artifacts"
command: |
source ~/.cargo/env
rustup default 1.51.0
rustup target add wasm32-unknown-unknown
./scripts/build_all.sh
- label: "cargo test"
command: |
source ~/.cargo/env
rustup default 1.51.0
rustup target add wasm32-unknown-unknown
./scripts/test_all.sh
5 changes: 5 additions & 0 deletions CONTRACTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lockup
lockup-factory
voting
whitelist
w-near
18 changes: 18 additions & 0 deletions scripts/build_all.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
#!/usr/bin/env bash
set -ex

CHECK=0

# Loop through arguments and process them
for arg in "$@"
do
case $arg in
-c|--check)
CHECK=1
shift
;;
esac
done

# Note: `staking-pool` has to be built before `staking-pool-factory`
for p in lockup multisig staking-pool staking-pool-factory voting whitelist
do
(cd ${p} && ./build.sh)
done

if [ $CHECK == 1 ] && [ "$(git diff --exit-code)" != 0 ] ; then
echo "Repository is dirty, please make sure you have committed all contract wasm files"
exit 1
fi
8 changes: 8 additions & 0 deletions scripts/test_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -ex

# Note: `staking-pool` has to be built before `staking-pool-factory`
while read -r contract
do
(cd ${contract} && RUSTFLAGS='-D warnings' cargo test)
done < CONTRACTS

0 comments on commit 2ad85f3

Please sign in to comment.