From 2a2791ece8a9f45b4c137bfdbed8c3b32c8bea8a Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Fri, 3 Dec 2021 09:58:34 +0400 Subject: [PATCH] Added bootstrap to push workflow. Signed-off-by: Aleksandr --- .github/workflows/iroha2-dev-pr-static.yml | 4 +- .github/workflows/iroha2-dev-pr-title.yml | 70 ++++++++++++++++---- .github/workflows/iroha2-dev-pr-unstable.yml | 2 +- .github/workflows/iroha2-dev-pr.yml | 4 +- .github/workflows/iroha2-dev.yml | 18 ++++- .github/workflows/iroha2-push-ci.yml | 22 ------ Dockerfile.ci | 4 +- p2p/src/lib.rs | 1 - 8 files changed, 82 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/iroha2-push-ci.yml diff --git a/.github/workflows/iroha2-dev-pr-static.yml b/.github/workflows/iroha2-dev-pr-static.yml index 4b3a08b491b..bca8b0ec7b8 100644 --- a/.github/workflows/iroha2-dev-pr-static.yml +++ b/.github/workflows/iroha2-dev-pr-static.yml @@ -11,7 +11,7 @@ on: jobs: check: - runs-on: [self-hosted, Linux] + runs-on: ubuntu-latest container: image: 7272721/i2-ci:latest steps: @@ -30,7 +30,7 @@ jobs: lscpu free -h - name: Format check - run: cargo +nightly-2021-10-22 fmt --all -- --check + run: cargo +nightly-2021-12-02 fmt --all -- --check - name: Static analysis without features run: cargo lints clippy --workspace --benches --tests --quiet if: always() diff --git a/.github/workflows/iroha2-dev-pr-title.yml b/.github/workflows/iroha2-dev-pr-title.yml index effbab6a03e..20e73cfc5ac 100644 --- a/.github/workflows/iroha2-dev-pr-title.yml +++ b/.github/workflows/iroha2-dev-pr-title.yml @@ -8,41 +8,87 @@ on: jobs: check_pr_title: runs-on: ubuntu-latest + # TODO: Add labels when https://github.com/actions/first-interaction/issues/10 is fixed. steps: - - uses: actions-ecosystem/action-regex-match@v2 + - name: Feature + uses: actions-ecosystem/action-regex-match@v2 id: feature-match with: text: ${{ github.event.pull_request.title }} - regex: '^\[(feature|feat\.?)\] \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):.+$' + regex: '^\[feature\] #\d+(, #\d+)*: .+$' + # - name: Add feature label + # uses: actions-ecosystem/action-add-labels@v1 + # if: ${{ steps.feature-match.outputs.match != '' }} + # continue-on-error: true + # with: + # github_token: ${{ secrets.github_token }} + # labels: | + # Enhancement - - uses: actions-ecosystem/action-regex-match@v2 + - name: Refactor + uses: actions-ecosystem/action-regex-match@v2 id: refactor-match if: ${{ steps.feature-match.outputs.match == '' }} with: text: ${{ github.event.pull_request.title }} - regex: '^\[ref(actor)?\]( \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):)?.+$' + regex: '^\[refactor\]( #\d+(, #\d+)*)?: .+$' + # - name: Add Refactor label + # uses: actions-ecosystem/action-add-labels@v1 + # if: ${{ steps.refactor-match.outputs.match != '' }} + # continue-on-error: true + # with: + # github_token: ${{ secrets.github_token }} + # labels: | + # Refactor - - uses: actions-ecosystem/action-regex-match@v2 + - name: Fix + uses: actions-ecosystem/action-regex-match@v2 id: fix-match if: ${{ steps.refactor-match.outputs.match == '' }} with: text: ${{ github.event.pull_request.title }} - regex: '^\[(bug)?fix(up)?\] \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):.+$' + regex: '\[fix\] #\d+(, #\d+)*: .+$' + # - name: Add fix label + # uses: actions-ecosystem/action-add-labels@v1 + # if: ${{ steps.fix-match.outputs.match != '' }} + # continue-on-error: true + # with: + # github_token: ${{ secrets.github_token }} + # labels: | + # Bug - - uses: actions-ecosystem/action-regex-match@v2 + - name: Documentation + uses: actions-ecosystem/action-regex-match@v2 id: docs-match if: ${{ steps.feature-match.outputs.match == '' }} with: text: ${{ github.event.pull_request.title }} - regex: '^\[doc(s|umentation)?\]( \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):)?.+$' + regex: '^\[documentation\]( #\d+(, #\d+)*)?: .+$' + # - name: Add Documentation label + # uses: actions-ecosystem/action-add-labels@v1 + # if: ${{ steps.docs-match.outputs.match != '' }} + # continue-on-error: true + # with: + # github_token: ${{ secrets.github_token }} + # labels: | + # Documentation - - uses: actions-ecosystem/action-regex-match@v2 + - name: CI + uses: actions-ecosystem/action-regex-match@v2 id: ci-match if: ${{ steps.feature-match.outputs.match == '' }} with: text: ${{ github.event.pull_request.title }} - regex: '^\[ci\]( \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):)?.+$' + regex: '^\[ci\]( #\d+(, #\d+)*)?: .+$' + # - name: Add CI label + # uses: actions-ecosystem/action-add-labels@v1 + # if: ${{ steps.ci-match.outputs.match != '' }} + # continue-on-error: true + # with: + # github_token: ${{ secrets.github_token }} + # labels: | + # CI - - name: Failure - if: ${{ steps.fix-match.outputs.match == '' && steps.refactor-match.outputs.match == '' && steps.feature-match.outputs.match == '' }} + - name: None of the above + if: ${{ steps.fix-match.outputs.match == '' && steps.refactor-match.outputs.match == '' && steps.feature-match.outputs.match == '' && steps.docs-match.outputs.match == '' && steps.ci-match.outputs.match == '' }} run: exit 1 diff --git a/.github/workflows/iroha2-dev-pr-unstable.yml b/.github/workflows/iroha2-dev-pr-unstable.yml index 25a857655ce..b78bfaada82 100644 --- a/.github/workflows/iroha2-dev-pr-unstable.yml +++ b/.github/workflows/iroha2-dev-pr-unstable.yml @@ -14,7 +14,7 @@ env: jobs: test: - runs-on: [self-hosted, Linux] + runs-on: ubuntu-latest container: image: 7272721/i2-ci:latest timeout-minutes: 60 diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml index 688abab86b2..0596e2924a1 100644 --- a/.github/workflows/iroha2-dev-pr.yml +++ b/.github/workflows/iroha2-dev-pr.yml @@ -14,7 +14,7 @@ env: jobs: test: - runs-on: [self-hosted, Linux] + runs-on: ubuntu-latest container: image: 7272721/i2-ci:latest timeout-minutes: 60 @@ -48,7 +48,7 @@ jobs: # 1. PR can get coverage report from bot. # 2 Coverage bot can have results from `iroha2-dev` to report coverage changes. coverage: - runs-on: [self-hosted, Linux] + runs-on: ubuntu-latest container: image: 7272721/i2-ci:latest steps: diff --git a/.github/workflows/iroha2-dev.yml b/.github/workflows/iroha2-dev.yml index 7fdeff601de..0e6e0d00017 100644 --- a/.github/workflows/iroha2-dev.yml +++ b/.github/workflows/iroha2-dev.yml @@ -9,7 +9,7 @@ env: jobs: deploy: - runs-on: [self-hosted, Linux] + runs-on: ubuntu-latest container: image: 7272721/i2-ci:latest steps: @@ -57,6 +57,22 @@ jobs: PROFILE=--release BIN=iroha_crypto_cli + build-ci-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build & push Docker container + uses: docker/build-push-action@v2 + with: + file: Dockerfile.ci + tags: hyperledger/ci-iroha2:latest + push: true + archive-and-publish-schema: runs-on: ubuntu-latest container: rust:1.56-buster diff --git a/.github/workflows/iroha2-push-ci.yml b/.github/workflows/iroha2-push-ci.yml deleted file mode 100644 index 55dd32f6dd9..00000000000 --- a/.github/workflows/iroha2-push-ci.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: I2::Dev::CI-push - -on: workflow_dispatch - -jobs: - # This isn't quite tested yet. It must get merged and succeed, and after that one more PR to - # update the rest of CI to use the new image. - build-ci-image: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build & push Docker container - uses: docker/build-push-action@v2 - with: - file: Dockerfile.ci - tags: i2-ci:latest - push: true diff --git a/Dockerfile.ci b/Dockerfile.ci index b178ab42dcb..808c70d7d5c 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.56.0 + RUST_VERSION=1.57.0 @@ -50,7 +50,7 @@ RUN git clone https://github.com/rui314/mold.git; \ rm -rf "./mold" RUN rustup component add llvm-tools-preview clippy; \ - rustup install --profile default nightly-2021-10-22; \ + rustup install --profile default nightly-2021-12-02; \ cargo install cargo-lints grcov RUN curl -fsSL https://get.docker.com -o get-docker.sh; \ diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs index c5c5a950093..ef35af417ac 100644 --- a/p2p/src/lib.rs +++ b/p2p/src/lib.rs @@ -19,7 +19,6 @@ pub mod peer; /// The main type to use for secure communication. pub type Network = NetworkBase; - /// Errors used in [`crate`]. #[derive(Clone, Debug, iroha_macro::FromVariant, Error, iroha_actor::Message)] pub enum Error {