Skip to content

Commit

Permalink
[ci] #1657: Update image to rust 1.57 (#1666)
Browse files Browse the repository at this point in the history
* [fix] #1630: Move back to self-hosted runners.

Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>

* More readable regex.

Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>

* Created a workflow-based regex matcher.

Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>

* Added bootstrap to push workflow.

Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>

* Fixed new clippy lints.

Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>

* Made trybuild tests pass.

Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>

* Removed cache from some jobs.

Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>
  • Loading branch information
appetrosyan authored Dec 3, 2021
1 parent 498bc56 commit 6cd608c
Show file tree
Hide file tree
Showing 67 changed files with 425 additions and 337 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/iroha2-add-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ jobs:
- uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.github_token }}
labels: iroha2
labels: |
iroha2
14 changes: 9 additions & 5 deletions .github/workflows/iroha2-dev-pr-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ name: I2::Dev::Static Analysis
on:
pull_request:
branches: [iroha2-dev]
paths:
- "**.rs"
- "**.json"
- "**.toml"
- "**.yml"

jobs:
check:
runs-on: ubuntu-latest
#container: rust:1.56-buster
container:
image: 7272721/i2-ci:latest
steps:
Expand All @@ -26,15 +30,15 @@ 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 --no-default-features
run: cargo lints clippy --workspace --benches --tests --quiet --no-default-features
if: always()
- name: Static analysis with all features enabled
run: cargo lints clippy --workspace --benches --tests --all-features
run: cargo lints clippy --workspace --benches --tests --all-features --quiet
if: always()
- name: Documentation check
run: |
cargo doc --no-deps
cargo doc --no-deps --quiet
./scripts/check_docs.sh
if: always()
88 changes: 83 additions & 5 deletions .github/workflows/iroha2-dev-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +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:
- name: Check PR title format
env:
PR_TITLE: ${{ github.event.pull_request.title }}
# Example: "[feature] #1: Some new feature"
run: echo $PR_TITLE | grep -Eq "^\[(feature|fix|refactor)\] \#[[:digit:]]+:.+$"
- name: Feature
uses: actions-ecosystem/action-regex-match@v2
id: feature-match
with:
text: ${{ github.event.pull_request.title }}
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

- 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: '^\[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

- 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: '\[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

- 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: '^\[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

- 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\]( #\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: 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
19 changes: 9 additions & 10 deletions .github/workflows/iroha2-dev-pr-unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ env:
jobs:
test:
runs-on: ubuntu-latest
#container: rust:1.56-buster
container:
image: 7272721/i2-ci:latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ env.CARGO_HOME }}
target/
key: iroha2-rust-test-${{ hashFiles('Cargo.lock') }}
restore-keys: |
iroha2-rust-test
# - uses: actions/cache@v2
# with:
# path: |
# ${{ env.CARGO_HOME }}
# target/
# key: iroha2-rust-test-${{ hashFiles('Cargo.lock') }}
# restore-keys: |
# iroha2-rust-test
- name: Run tests
run: cargo test -p iroha_client --tests unstable_network
run: cargo test -p iroha_client --tests unstable_network --quiet
42 changes: 20 additions & 22 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,30 @@ env:
jobs:
test:
runs-on: ubuntu-latest
#container: rust:1.56-buster
container:
image: 7272721/i2-ci:latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ env.CARGO_HOME }}
target/
key: iroha2-rust-test-${{ hashFiles('Cargo.lock') }}
restore-keys: |
iroha2-rust-test
# - uses: actions/cache@v2
# with:
# path: |
# ${{ env.CARGO_HOME }}
# target/
# key: iroha2-rust-test-${{ hashFiles('Cargo.lock') }}
# restore-keys: |
# iroha2-rust-test
- name: Run tests
run: mold -run cargo test --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
run: mold -run cargo test --features mock -- --ignored --skip unstable_network --test-threads 2
run: mold -run cargo test --quiet --features mock -- --ignored --skip unstable_network --test-threads 2
env:
RUSTC_BOOTSTRAP: 1
working-directory: core/test_network
- name: Run iroha_actor deadlock detection tests
run: mold -run cargo test --features deadlock_detection -- --skip unstable_network --test-threads 2
run: mold -run cargo test --quiet --features deadlock_detection -- --skip unstable_network --test-threads 2
if: always()
env:
RUSTC_BOOTSTRAP: 1
Expand All @@ -50,21 +49,20 @@ jobs:
# 2 Coverage bot can have results from `iroha2-dev` to report coverage changes.
coverage:
runs-on: ubuntu-latest
#container: rust:1.56-buster
container:
image: 7272721/i2-ci:latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ env.CARGO_HOME }}
target/
key: iroha2-rust-test-coverage-${{ hashFiles('Cargo.lock') }}
restore-keys: |
iroha2-rust-test-coverage
# - uses: actions/cache@v2
# with:
# path: |
# ${{ env.CARGO_HOME }}
# target/
# key: iroha2-rust-test-coverage-${{ hashFiles('Cargo.lock') }}
# restore-keys: |
# iroha2-rust-test-coverage
- name: Run tests
run: mold -run cargo test --workspace --no-fail-fast -- --skip unstable_network --test-threads 2 || true
run: mold -run cargo test --quiet --workspace --no-fail-fast -- --skip unstable_network --test-threads 2 || true
env:
RUSTFLAGS: "-Zinstrument-coverage"
RUSTC_BOOTSTRAP: 1
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/iroha2-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ env:
jobs:
deploy:
runs-on: ubuntu-latest
# container: rust:1.56-buster
container:
image: 7272721/i2-ci:latest
steps:
Expand Down Expand Up @@ -58,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
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/iroha2-push-ci.yml

This file was deleted.

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.

4 changes: 2 additions & 2 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down Expand Up @@ -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; \
Expand Down
2 changes: 1 addition & 1 deletion actor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ thiserror = "1.0.28"
petgraph = { version = "0.5", optional = true }

[dev-dependencies]
trybuild = "1"
trybuild = "1.0.53"
6 changes: 4 additions & 2 deletions actor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//!
//! Iroha simple actor framework.
//!
#![allow(clippy::same_name_method)]

#[cfg(feature = "deadlock_detection")]
use std::any::type_name;
Expand Down Expand Up @@ -128,8 +127,10 @@ impl<A: Actor> Addr<A> {
}

/// Send a message and wait for an answer.
///
/// # Errors
/// Fails if no one will send message
///
/// # Panics
/// If queue is full
pub async fn send<M>(&self, message: M) -> Result<M::Result, Error>
Expand All @@ -149,6 +150,7 @@ impl<A: Actor> Addr<A> {
}

/// Send a message without waiting for an answer.
///
/// # Errors
/// Fails if queue is full or actor is disconnected
pub async fn do_send<M>(&self, message: M)
Expand Down
Loading

0 comments on commit 6cd608c

Please sign in to comment.