Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Enable PR CI in branch #1690

Merged
merged 1 commit into from Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-add-label.yml
Expand Up @@ -2,7 +2,7 @@ name: Add Iroha2 label

on:
pull_request_target:
branches: [iroha2-dev, iroha2]
branches: [iroha2-dev, iroha2, 2.0.0-pre.1.rc.1]
types: [opened]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-pr-static.yml
Expand Up @@ -2,7 +2,7 @@ name: I2::Dev::Static Analysis

on:
pull_request:
branches: [iroha2-dev]
branches: [iroha2-dev, 2.0.0-pre.1.rc.1]
paths:
- "**.rs"
- "**.json"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-pr-title.yml
Expand Up @@ -2,7 +2,7 @@ name: Check PR Title

on:
pull_request:
branches: [iroha2-dev]
branches: [iroha2-dev, 2.0.0-pre.1.rc.1]
types: [opened, edited, reopened]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-pr-unstable.yml
Expand Up @@ -2,7 +2,7 @@ name: I2::Dev::Tests (Unstable)

on:
pull_request:
branches: [iroha2-dev]
branches: [iroha2-dev, 2.0.0-pre.1.rc.1]
paths:
- "**.rs"
- "**.json"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/iroha2-dev-pr.yml
Expand Up @@ -2,7 +2,7 @@ name: I2::Dev::Tests

on:
pull_request:
branches: [iroha2-dev]
branches: [iroha2-dev, 2.0.0-pre.1.rc.1]
paths:
- "**.rs"
- "**.json"
Expand All @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: mold -run cargo test --quiet --workspace --no-fail-fast -- --skip unstable_network --test-threads 2
run: mold -run cargo test --quiet --workspace --no-fail-fast -- --skip unstable_network --test-threads 2
env:
RUSTC_BOOTSTRAP: 1
- name: Run iroha tests with network mock
Expand Down
124 changes: 124 additions & 0 deletions .github/workflows/iroha2-pre1-rc1.yml
@@ -0,0 +1,124 @@
name: Iroha 2 dev branch workflow

on:
push:
branches: [2.0.0-pre.1.rc.1]

env:
CARGO_TERM_COLOR: always

jobs:
deploy:
runs-on: ubuntu-latest
container:
image: 7272721/i2-ci:latest
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: set up buildx
uses: docker/setup-buildx-action@v1
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Iroha Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: hyperledger/iroha2:2.0.0-pre.1.rc.1
build-args: |
TARGET_DIR=release
PROFILE=--release

- name: Build and push Iroha client cli Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: hyperledger/iroha2:client-cli-2.0.0-pre.1.rc.1
build-args: |
TARGET_DIR=release
PROFILE=--release
BIN=iroha_client_cli

- name: Build and push Iroha Crypto CLI Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: hyperledger/iroha2:crypto-cli-2.0.0-pre.1.rc.1
build-args: |
TARGET_DIR=release
PROFILE=--release
BIN=iroha_crypto_cli

archive-and-publish-schema:
runs-on: ubuntu-latest
container:
image: 7272721/i2-ci:latest
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
llvm-dev
- name: Build
run: cargo build --release --verbose
- name: Archive build
uses: actions/upload-artifact@v2
with:
name: cargo-build-release
path: target/release/iroha
- name: Archive Client CLI build
uses: actions/upload-artifact@v2
with:
name: cargo-client-cli-build-release
path: target/release/iroha_client_cli
- name: Archive Crypto CLI build
uses: actions/upload-artifact@v2
with:
name: cargo-crypto-cli-build-release
path: target/release/iroha_crypto_cli
- name: Run schema generation
run: |
mkdir -p target/schema
cargo run -p iroha_schema_bin > target/schema/schema.json
- name: Upload schema
uses: actions/upload-artifact@v2
with:
name: schema
path: target/schema

# Coverage is both in PR and in push pipelines so that:
# 1. PR can get coverage report from bot.
# 2 Coverage bot can have results from `iroha2-dev` to report coverage changes.
coverage:
runs-on: ubuntu-latest
container:
image: 7272721/i2-ci:latest
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: mold -run cargo test --workspace --no-fail-fast -- --skip unstable_network || true
env:
RUSTFLAGS: "-Zinstrument-coverage"
RUSTC_BOOTSTRAP: 1
LLVM_PROFILE_FILE: "iroha-%p-%m.profraw"
- name: Generate a grcov coverage report
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v1
with:
file: lcov.info