Skip to content

Commit

Permalink
Merge pull request #621 from Joystream/proposal_discussion_release
Browse files Browse the repository at this point in the history
Proposal discussion Release into Master
  • Loading branch information
mnaamani authored Jun 8, 2020
2 parents b171fcc + ea42203 commit 7ec3ac0
Show file tree
Hide file tree
Showing 1,155 changed files with 108,037 additions and 347 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/pioneer-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Pioneer
on: [pull_request, push]

jobs:
pioneer_build_ubuntu:
name: Ubuntu Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: build
run: |
yarn install --frozen-lockfile
yarn workspace pioneer build
pioneer_build_osx:
name: MacOS Build
runs-on: macos-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: build
run: |
yarn install --frozen-lockfile
yarn workspace pioneer build
pioneer_lint_ubuntu:
name: Ubuntu Linting
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: lint
run: |
yarn install --frozen-lockfile
yarn workspace pioneer lint
pioneer_lint_osx:
name: MacOS Linting
runs-on: macos-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: lint
run: |
yarn install --frozen-lockfile
yarn workspace pioneer lint
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ joystream_runtime.wasm

# Generated by yarn
yarn*
!yarn.lock

# JetBrains IDEs
.idea
Expand All @@ -24,4 +25,10 @@ yarn*
.vscode

# Compiled WASM code
*.wasm
*.wasm

# Temporary files
.tmp/

# Istanbul report output
**.nyc_output/
103 changes: 21 additions & 82 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,35 @@
language: rust

# Caching of the runtime .wasm blob poses a problem.
# See: https://github.com/Joystream/joystream/issues/466
# Always starting with a clean slate is probably better, it allows us to ensure
# the WASM runtime is always rebuilt. It also allows us to detect when certain upstream dependencies
# sometimes break the build. When cache is enabled do not use the produced WASM build.
# This also means the binary should not be used to produce the final chainspec file (because the same
# one is embedded in the binary)
cache: cargo

rust:
- 1.43.0
- stable

matrix:
include:
- os: linux
env: TARGET=x86_64-unknown-linux-gnu
- os: linux
env: TARGET=arm-unknown-linux-gnueabihf
services: docker
- os: osx
env: TARGET=x86_64-apple-darwin
- os: linux
env: TARGET=wasm-blob
services: docker

before_install:
install:
- rustup install nightly-2020-05-23
- rustup target add wasm32-unknown-unknown --toolchain nightly-2020-05-23
# travis installs rust using rustup with the "minimal" profile so these tools are not installed by default
- rustup component add rustfmt
- cargo fmt --all -- --check
- rustup component add clippy
- BUILD_DUMMY_WASM_BINARY=1 cargo clippy -- -D warnings
- rustup default stable
- rustup update nightly
- rustup target add wasm32-unknown-unknown --toolchain nightly
- cargo test --verbose --all

install:
- |
if [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]
then
docker pull joystream/rust-raspberry
fi
before_script:
- cargo fmt --all -- --check

script:
- |
if [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]
then
docker run -u root \
--volume ${TRAVIS_BUILD_DIR}:/home/cross/project \
joystream/rust-raspberry \
build --release
sudo chmod a+r ${TRAVIS_BUILD_DIR}/target/${TARGET}/release/joystream-node
elif [ "$TARGET" = "wasm-blob" ]
then
docker build --tag joystream/node \
--file ./devops/dockerfiles/node-and-runtime/Dockerfile \
.
docker create --name temp-container-joystream-node joystream/node
docker cp temp-container-joystream-node:/joystream/runtime.compact.wasm joystream_runtime.wasm
docker rm temp-container-joystream-node
else
cargo build --release --target=${TARGET}
fi
before_deploy:
- |
if [ "$TARGET" = "wasm-blob" ]
then
export ASSET="joystream_runtime.wasm"
else
cp ./target/${TARGET}/release/joystream-node .
if [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]
then
export FILENAME="joystream-node-armv7-linux-gnueabihf"
else
export FILENAME=`./joystream-node --version | sed -e "s/ /-/g"`
fi
tar -cf ${FILENAME}.tar ./joystream-node
gzip ${FILENAME}.tar
export ASSET=${FILENAME}.tar.gz
fi
deploy:
- provider: releases
api_key:
secure: FfxZGQexxAGT0Skbctl1FuqmEvNHejPDPtNG8Du1ACSGjS7Y+M6o/aPqE6HL158AmddOgndsIPR+HM7VfMDAUMkLTbOhv3nMpDBZu1h25vwk+jHOM65tm5LWUu/ROWBpaAQiG7NKrvtfkNfbNBSETsEbWBt/DPrhlIfSbgsXBFDiid7uRrCiwvDUJ097/EUOJ9OVUrk+O4ebSzfIfKPGPtRU2rQQ0eNX7yX3TCm3jbQm/kplkQNRL9mnAJNxtKuvuko4LqZ6jN4XLoLTHUMjO7E0r6wXVB4GVjA4HA214eLlQD6BhgTbWMDxKgWyuKzPG+2GLKyluSSn0RurSl8tYryXKxKxuN3H1FX9r23a8AzGtpRACJtIePC2YmPuQRSnz2Bw8jlSP2WPLJtXGD036J/wVMj6W9TROm7IBigiC7QlqAqCYNByOnoKyhRCgYyAJZb0Jpa3qWaFhA6b6gCGhyH85QCcrc0q6JAB3oqH8Wfm/K2HVzBobmKaSFu5DpwInNnUXnLWGVzhSt3oCq6ld773izReGdLJtLC2vaJ9rZVaVw29s9M662EEuAGgaVLO/sinZJFeIIaCF4i4zUXwXSLIdfKXGOR0ZibkyT2FS6qPGvl/lLN5IREzD7v/rV8htGMLmw4jpPLNskvRjCHX42ewRRYdMvZzQQOAvSlWcsw=
file: ${ASSET}
on:
tags: true
repo: Joystream/joystream
draft: true
overwrite: true
skip_cleanup: true
- provider: releases
api_key:
secure: FfxZGQexxAGT0Skbctl1FuqmEvNHejPDPtNG8Du1ACSGjS7Y+M6o/aPqE6HL158AmddOgndsIPR+HM7VfMDAUMkLTbOhv3nMpDBZu1h25vwk+jHOM65tm5LWUu/ROWBpaAQiG7NKrvtfkNfbNBSETsEbWBt/DPrhlIfSbgsXBFDiid7uRrCiwvDUJ097/EUOJ9OVUrk+O4ebSzfIfKPGPtRU2rQQ0eNX7yX3TCm3jbQm/kplkQNRL9mnAJNxtKuvuko4LqZ6jN4XLoLTHUMjO7E0r6wXVB4GVjA4HA214eLlQD6BhgTbWMDxKgWyuKzPG+2GLKyluSSn0RurSl8tYryXKxKxuN3H1FX9r23a8AzGtpRACJtIePC2YmPuQRSnz2Bw8jlSP2WPLJtXGD036J/wVMj6W9TROm7IBigiC7QlqAqCYNByOnoKyhRCgYyAJZb0Jpa3qWaFhA6b6gCGhyH85QCcrc0q6JAB3oqH8Wfm/K2HVzBobmKaSFu5DpwInNnUXnLWGVzhSt3oCq6ld773izReGdLJtLC2vaJ9rZVaVw29s9M662EEuAGgaVLO/sinZJFeIIaCF4i4zUXwXSLIdfKXGOR0ZibkyT2FS6qPGvl/lLN5IREzD7v/rV8htGMLmw4jpPLNskvRjCHX42ewRRYdMvZzQQOAvSlWcsw=
file: ${ASSET}
on:
branch: development
repo: Joystream/joystream
draft: true
prerelease: true
overwrite: true
skip_cleanup: true
# we set release as build type for all steps to benefit from already compiled packages in prior steps
- BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --target=${TARGET} -- -D warnings
- BUILD_DUMMY_WASM_BINARY=1 cargo test --release --verbose --all --target=${TARGET}
- TRIGGER_WASM_BUILD=1 WASM_BUILD_TOOLCHAIN=nightly-2020-05-23 cargo build --release --target=${TARGET} -p joystream-node
- ls -l ./target/${TARGET}/release/wbuild/joystream-node-runtime/
2 changes: 2 additions & 0 deletions .yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@types/react-native
@polkadot/ts/node_modules
4 changes: 2 additions & 2 deletions Cargo.lock

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

13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,23 @@ This will build and run a fresh new local development chain purging existing one
cargo test
```

### API integration tests
### Network tests

```bash
./scripts/run-dev-chain.sh
./scripts/run-test-chain.sh
yarn test
```

To run the integration tests with a different chain, you can omit step running the local development chain and set the node URL using `NODE_URL` environment variable.
Proposal grace periods should be set to 0, otherwise proposal network tests will fail.

### Rome-Constantinople migration network test

Ensure Rome node is up and running, and node URL is set using `NODE_URL` environment variable (default value is `localhost:9944`).

```bash
yarn test-migration
```

## Joystream Runtime

Expand Down
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"bugs": "https://github.com/Joystream/substrate-runtime-joystream/issues",
"dependencies": {
"@joystream/types": "^0.6.0",
"@joystream/types": "^0.10.0",
"@oclif/command": "^1.5.19",
"@oclif/config": "^1.14.0",
"@oclif/plugin-help": "^2.2.3",
Expand Down
2 changes: 1 addition & 1 deletion cli/src/Api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BN from 'bn.js';
import { registerJoystreamTypes } from '@joystream/types';
import { registerJoystreamTypes } from '@joystream/types/';
import { ApiPromise, WsProvider } from '@polkadot/api';
import { QueryableStorageMultiArg } from '@polkadot/api/types';
import { formatBalance } from '@polkadot/util';
Expand Down
2 changes: 1 addition & 1 deletion cli/src/Types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BN from 'bn.js';
import { ElectionStage, Seat } from '@joystream/types';
import { ElectionStage, Seat } from '@joystream/types/';
import { Option } from '@polkadot/types';
import { BlockNumber, Balance } from '@polkadot/types/interfaces';
import { DerivedBalances } from '@polkadot/api-derive/types';
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/council/info.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElectionStage } from '@joystream/types';
import { ElectionStage } from '@joystream/types/';
import { formatNumber, formatBalance } from '@polkadot/util';
import { BlockNumber } from '@polkadot/types/interfaces';
import { CouncilInfoObj, NameValueObj } from '../../Types';
Expand Down
3 changes: 2 additions & 1 deletion devops/dockerfiles/node-and-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ LABEL description="Compiles all workspace artifacts"
WORKDIR /joystream
COPY . /joystream

RUN cargo build --release
# Build joystream-node and its dependencies - runtime
RUN cargo build --release -p joystream-node

FROM debian:stretch
LABEL description="Joystream node"
Expand Down
10 changes: 5 additions & 5 deletions devops/git-hooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh
set -e

export BUILD_DUMMY_WASM_BINARY=1
echo '+cargo test --release --all'
BUILD_DUMMY_WASM_BINARY=1 cargo test --all

echo '+cargo clippy --release --all -- -D warnings'
BUILD_DUMMY_WASM_BINARY=1 cargo clippy --all -- -D warnings

echo '+cargo test --all'
cargo test --all

echo '+cargo clippy --all -- -D warnings'
cargo clippy --all -- -D warnings
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ['Joystream']
build = 'build.rs'
edition = '2018'
name = 'joystream-node'
version = '2.2.0'
version = '2.3.0'
default-run = "joystream-node"

[[bin]]
Expand Down
59 changes: 38 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
{
"private": true,
"name": "joystream",
"license": "GPL-3.0-only",
"scripts": {
"test": "yarn && yarn workspaces run test",
"test-migration": "yarn && yarn workspaces run test-migration"
},
"workspaces": [
"tests/network-tests"
],
"devDependencies": {
"husky": "^4.2.5"
},
"husky": {
"hooks": {
"pre-commit": "devops/git-hooks/pre-commit",
"pre-push": "devops/git-hooks/pre-push"
}
}
}
{
"private": true,
"name": "joystream",
"license": "GPL-3.0-only",
"scripts": {
"test": "yarn && yarn workspaces run test",
"test-migration": "yarn && yarn workspaces run test-migration",
"postinstall": "yarn workspace @joystream/types build",
"cargo-checks": "devops/git-hooks/pre-commit && devops/git-hooks/pre-push",
"cargo-build": "scripts/cargo-build.sh"
},
"workspaces": [
"tests/network-tests",
"cli",
"types",
"pioneer",
"pioneer/packages/*"
],
"resolutions": {
"@polkadot/api": "^0.96.1",
"@polkadot/api-contract": "^0.96.1",
"@polkadot/keyring": "^1.7.0-beta.5",
"@polkadot/types": "^0.96.1",
"@polkadot/util": "^1.7.0-beta.5",
"@polkadot/util-crypto": "^1.7.0-beta.5",
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.7.2"
},
"devDependencies": {
"husky": "^4.2.5"
},
"husky": {
"hooks": {
"pre-commit": "devops/git-hooks/pre-commit",
"pre-push": "devops/git-hooks/pre-push"
}
}
}
1 change: 1 addition & 0 deletions pioneer/.123trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
1 change: 1 addition & 0 deletions pioneer/.babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./babel.config.js');
3 changes: 3 additions & 0 deletions pioneer/.codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exclude_patterns:
- "**/*.spec.js"
- "**/*.spec.ts"
1 change: 1 addition & 0 deletions pioneer/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Loading

0 comments on commit 7ec3ac0

Please sign in to comment.