Skip to content

Commit

Permalink
ci: reorganise workflows
Browse files Browse the repository at this point in the history
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>
  • Loading branch information
0x009922 committed Oct 4, 2024
1 parent 9418686 commit 23268ba
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 266 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/iroha2-dev-nightly.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/iroha2-dev-pr-static.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/workflows/iroha2-dev-pr-wasm.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/iroha2-label.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/iroha2-no-incorrect-image.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/iroha2-pr-ui.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: I2::Dev::Publish
name: publish/dev

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: I2::CI::Publish
name: publish/manual

on:
workflow_dispatch:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: I2::Release::Publish
name: publish/what?

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: I2::Custom::Publish
name: publish/what 2?

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: I2::Dev::Tests
name: pull_request

on:
pull_request:
Expand All @@ -9,7 +9,7 @@ on:
- '**.toml'
- '**.lock'
- '**.py'
- '.github/workflows/iroha2-dev-pr.yml'
- 'pull_request.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -45,7 +45,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Format
if: always()
run: cargo fmt --all -- --check
- name: Format (wasm_samples)
run: cargo fmt --manifest-path wasm_samples/Cargo.toml --all -- --check
- name: Lints without features
if: always()
run: cargo clippy --workspace --benches --tests --examples --no-default-features --quiet
Expand All @@ -61,6 +64,33 @@ jobs:
name: report-clippy
path: clippy.json

python_static_analysis:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
strategy:
matrix:
suite: [iroha_cli_tests, iroha_torii_tests]
steps:
- uses: actions/checkout@v4
- name: Install dependencies using Poetry for pytests/${{ matrix.suite }}
working-directory: pytests/${{ matrix.suite }}
run: |
poetry lock --no-update
poetry install
- name: Check code formatting with Black in pytests/${{ matrix.suite }}
working-directory: pytests/${{ matrix.suite }}
run: |
poetry run black --check .
- name: Run mypy (Type Checker) in pytests/${{ matrix.suite }}
working-directory: pytests/${{ matrix.suite }}
run: |
poetry run mypy --explicit-package-bases --ignore-missing-imports .
- name: Run flake8 (Linter) in pytests/${{ matrix.suite }}
working-directory: pytests/${{ matrix.suite }}
run: |
poetry run flake8 . --max-line-length=110 --ignore=F401,W503,E203
build_wasm_samples:
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -128,6 +158,25 @@ jobs:
name: report-coverage
path: lcov.info

test_wasms:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
needs: build_wasm_samples
steps:
- uses: actions/checkout@v4
- name: Download executor.wasm
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Install iroha_wasm_test_runner
run: which iroha_wasm_test_runner || cargo install --path crates/iroha_wasm_test_runner
- name: Run smart contract tests on WebAssembly VM
working-directory: crates/iroha_smart_contract
run: mold --run cargo test -p iroha_smart_contract -p iroha_smart_contract_utils --release --tests --target wasm32-unknown-unknown --no-fail-fast --quiet


# Run the job to check that the docker containers are properly buildable
pr-generator-build:
# Job will only execute if the head of the pull request is a branch for PR-generator case
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pull_request_labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: pull_request/labels

on:
pull_request_target:

jobs:
main:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- id: label-the-PR
uses: actions/labeler@v5
- uses: mshick/add-pr-comment@v2
if: contains(steps.label-the-PR.outputs.all-labels, 'config-changes')
with:
message: |
@BAStos525
Loading

0 comments on commit 23268ba

Please sign in to comment.