Skip to content

Commit

Permalink
Merge pull request #2 from celo-org/master
Browse files Browse the repository at this point in the history
master
  • Loading branch information
aaitor committed Oct 28, 2019
2 parents 2b57e99 + 4d96abb commit dbf364d
Show file tree
Hide file tree
Showing 376 changed files with 18,018 additions and 15,385 deletions.
163 changes: 44 additions & 119 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

version: 2
reference:
workspace: &workspace
~/src
workspace: &workspace ~/src
## Configurations
android_config: &android_config
working_directory: *workspace
Expand All @@ -15,7 +14,6 @@ reference:
TERM: dumb
JVM_OPTS: -Xmx3200m


defaults: &defaults
working_directory: ~/app
docker:
Expand All @@ -32,6 +30,11 @@ android-defaults: &android-defaults
_JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError"'

e2e-defaults: &e2e-defaults
<<: *defaults
docker:
- image: celohq/circleci

general:
artifacts:
- "mobile/coverage"
Expand Down Expand Up @@ -161,7 +164,7 @@ jobs:
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install android-platform-tools
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask-versions
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install homebrew/cask-versions/adoptopenjdk8
- run:
- run:
name: Creace Android Virtual Device (AVD)
command: |
avdmanager create avd -n Nexus_5X_API_28_x86 -k "system-images;android-26;google_apis;x86" -g google_apis -d "Nexus 5"
Expand All @@ -182,7 +185,7 @@ jobs:
name: install miscellaneous
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install tree
# Currently not used
# - run: npm install --global react-native-kill-packager
# - run: npm install --global react-native-kill-packager
- run:
# need to run this because it's another OS than install_dependecies job
name: yarn
Expand All @@ -196,7 +199,7 @@ jobs:
# yarn postinstall
# fi
yarn
yarn build
yarn build
- save_cache:
key: yarn-v4-macos-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
Expand All @@ -212,7 +215,7 @@ jobs:
name: Start emulator
command: cd ~/src/packages/mobile && bash ./scripts/start_emulator.sh
background: true
- run:
- run:
name: Start metro
command: cd ~/src/packages/mobile && yarn start
background: true
Expand All @@ -237,13 +240,13 @@ jobs:
paths:
- ~/src/packages/mobile/android/app/build/outputs/apk/
- ~/.gradle/

lint-checks:
<<: *defaults
steps:
- attach_workspace:
at: ~/app
# If this fails, fix it with
# If this fails, fix it with
# `./node_modules/.bin/prettier --config .prettierrc.js --write '**/*.+(ts|tsx|js|jsx)'`
- run: yarn run prettify:diff
- run: yarn run lint
Expand Down Expand Up @@ -460,7 +463,7 @@ jobs:
steps:
- attach_workspace:
at: ~/app

- run:
name: Install and test the npm package
command: |
Expand All @@ -475,7 +478,7 @@ jobs:
steps:
- attach_workspace:
at: ~/app

- run:
name: Install and test the npm package
command: |
Expand All @@ -486,7 +489,7 @@ jobs:
npm install ~/app/packages/utils/*.tgz
end-to-end-geth-transfer-test:
<<: *defaults
<<: *e2e-defaults
steps:
- attach_workspace:
at: ~/app
Expand All @@ -495,37 +498,16 @@ jobs:
command: |
FILES_TO_CHECK="${PWD}/packages/celotool,${PWD}/packages/protocol,${PWD}/.circleci/config.yml"
./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK}
- run:
name: Setup Go language
command: |
set -e
set -v
wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
tar xf go1.11.5.linux-amd64.tar.gz -C /tmp
ls /tmp/go/bin/go
/tmp/go/bin/go version
- run:
name: Setup Rust language
command: |
set -e
set -v
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
rustup install 1.36.0
rustup default 1.36.0
- run:
name: Run test
no_output_timeout: 20m
command: |
set -e
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
go version
cd packages/celotool
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
./ci_test_transfers.sh checkout master
end-to-end-geth-exit-test:
<<: *defaults
<<: *e2e-defaults
steps:
- attach_workspace:
at: ~/app
Expand All @@ -534,37 +516,16 @@ jobs:
command: |
FILES_TO_CHECK="${PWD}/packages/celotool,${PWD}/packages/protocol,${PWD}/.circleci/config.yml"
./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK}
- run:
name: Setup Go language
command: |
set -e
set -v
wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
tar xf go1.11.5.linux-amd64.tar.gz -C /tmp
ls /tmp/go/bin/go
/tmp/go/bin/go version
- run:
name: Setup Rust language
command: |
set -e
set -v
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
rustup install 1.36.0
rustup default 1.36.0
- run:
name: Run test
no_output_timeout: 20m
command: |
set -e
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
go version
cd packages/celotool
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
./ci_test_exit.sh checkout master
end-to-end-geth-governance-test:
<<: *defaults
<<: *e2e-defaults
# Source: https://circleci.com/docs/2.0/configuration-reference/#resource_class
resource_class: medium+
steps:
Expand All @@ -575,37 +536,16 @@ jobs:
command: |
FILES_TO_CHECK="${PWD}/packages/celotool,${PWD}/packages/protocol,${PWD}/.circleci/config.yml"
./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK}
- run:
name: Setup Go language
command: |
set -e
set -v
wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
tar xf go1.11.5.linux-amd64.tar.gz -C /tmp
ls /tmp/go/bin/go
/tmp/go/bin/go version
- run:
name: Setup Rust language
command: |
set -e
set -v
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
rustup install 1.36.0
rustup default 1.36.0
- run:
name: Run test
no_output_timeout: 20m
command: |
set -e
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
go version
cd packages/celotool
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
./ci_test_governance.sh checkout master
end-to-end-geth-sync-test:
<<: *defaults
<<: *e2e-defaults
# Source: https://circleci.com/docs/2.0/configuration-reference/#resource_class
resource_class: medium+
steps:
Expand All @@ -616,36 +556,15 @@ jobs:
command: |
FILES_TO_CHECK="${PWD}/packages/celotool,${PWD}/packages/protocol,${PWD}/.circleci/config.yml"
./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK}
- run:
name: Setup Go language
command: |
set -e
set -v
wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
tar xf go1.11.5.linux-amd64.tar.gz -C /tmp
ls /tmp/go/bin/go
/tmp/go/bin/go version
- run:
name: Setup Rust language
command: |
set -e
set -v
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
rustup install 1.36.0
rustup default 1.36.0
- run:
name: Run test
command: |
set -e
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
go version
cd packages/celotool
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
./ci_test_sync.sh checkout master
end-to-end-geth-integration-sync-test:
<<: *defaults
<<: *e2e-defaults
steps:
- attach_workspace:
at: ~/app
Expand All @@ -655,27 +574,29 @@ jobs:
FILES_TO_CHECK="${PWD}/packages/celotool,${PWD}/packages/protocol,${PWD}/.circleci/config.yml"
./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK}
- run:
name: Setup Go language
name: Run test
command: |
set -e
set -v
wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
tar xf go1.11.5.linux-amd64.tar.gz -C /tmp
ls /tmp/go/bin/go
/tmp/go/bin/go version
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
rustup install 1.36.0
rustup default 1.36.0
cd packages/celotool
./ci_test_sync_with_network.sh checkout master
end-to-end-geth-attestations-test:
<<: *e2e-defaults
resource_class: medium+
steps:
- attach_workspace:
at: ~/app
- run:
name: Check if the test should run
command: |
FILES_TO_CHECK="${PWD}/packages/celotool,${PWD}/packages/protocol,${PWD}/.circleci/config.yml"
./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK}
- run:
name: Run test
command: |
set -e
export PATH=${PATH}:~/.cargo/bin:/tmp/go/bin
go version
cd packages/celotool
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
./ci_test_sync_with_network.sh checkout master
./ci_test_attestations.sh checkout master
web:
working_directory: ~/app
Expand Down Expand Up @@ -788,23 +709,27 @@ workflows:
- end-to-end-geth-transfer-test:
requires:
- lint-checks
- walletkit-test
- contractkit-test
- end-to-end-geth-exit-test:
requires:
- lint-checks
- walletkit-test
- contractkit-test
- end-to-end-geth-governance-test:
requires:
- lint-checks
- walletkit-test
- contractkit-test
- end-to-end-geth-sync-test:
requires:
- lint-checks
- walletkit-test
- contractkit-test
- end-to-end-geth-integration-sync-test:
requires:
- lint-checks
- walletkit-test
- contractkit-test
- end-to-end-geth-attestations-test:
requires:
- lint-checks
- contractkit-test
npm-install-testing-cron-workflow:
triggers:
- schedule:
Expand Down
6 changes: 4 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ CLUSTER_DOMAIN_NAME="celo-networks-dev"
TESTNET_PROJECT_NAME="celo-testnet"

BLOCKSCOUT_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/blockscout"
BLOCKSCOUT_WEB_DOCKER_IMAGE_TAG="web-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_INDEXER_DOCKER_IMAGE_TAG="indexer-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_DOCKER_IMAGE_TAG="5fba4843b3e78b5ab75d01766214cb24c6a40649"
BLOCKSCOUT_WEB_REPLICAS=3
BLOCKSCOUT_DB_SUFFIX=

ETHSTATS_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/ethstats"
ETHSTATS_DOCKER_IMAGE_TAG="i0ffe524c625ea59e4492dc92c2e638689c36e4b0"

GETH_NODE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-testnet/geth"
# When upgrading change this to latest commit hash from the master of the geth repo
# `geth $ git show | head -n 1`
Expand Down
3 changes: 1 addition & 2 deletions .env.integration
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ CLUSTER_DOMAIN_NAME="celo-testnet"
TESTNET_PROJECT_NAME="celo-testnet"

BLOCKSCOUT_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/blockscout"
BLOCKSCOUT_WEB_DOCKER_IMAGE_TAG="web-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_INDEXER_DOCKER_IMAGE_TAG="indexer-f6c3e0888d1d0ef72dc8bf870808702b7fd13730"
BLOCKSCOUT_DOCKER_IMAGE_TAG="ad86714d629c01272e0651dec1fb6a968c3cec71"
BLOCKSCOUT_WEB_REPLICAS=3
BLOCKSCOUT_DB_SUFFIX="25"
BLOCKSCOUT_SUBNETWORK_NAME="Integration"
Expand Down
21 changes: 21 additions & 0 deletions README-dev.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# README GUIDE FOR CELO DEVELOPERS

## Monorepo inter-package dependencies

Many packages depend on other packages within the monorepo. When this happens, follow these rules:

1. All packages must use **master version** of sibling packages.
2. Exception to (1) are packages that represent a GAE/firebase app which must use the last published version.
3. To differentiate published vs unpublished version. Master version (in package.json) must end with suffix `-dev` and should not be published.
4. If a developer want to publish a version; then after publishing it needs to set master version to next `-dev` version and change all package.json that require on it.

To check which pakages need amending, you can run (in the root pkg):

yarn check:packages

A practical example:

- In any given moment, `contractkit/package.json#version` field **must** of the form `x.y.z-dev`
- If current version of contractkit is: `0.1.6-dev` and we want to publish a new version, we should:
- publish version `0.1.6`
- change `package.json#version` to `0.1.7-dev`
- change in other packages within monorepo that were using `0.1.6-dev` to `0.1.7-dev`

## How to publish a new npm package

First checkout the alfajores branch.
Expand Down
Loading

0 comments on commit dbf364d

Please sign in to comment.