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: reorganise workflows [EXPERIMENTAL] #5125

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: reorganise workflows
Signed-off-by: 0x009922 <[email protected]>
  • Loading branch information
0x009922 committed Oct 9, 2024
commit a440187768aed1c1950178a46274741b0176b603
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 @@ -46,7 +46,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 @@ -62,6 +65,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 @@ -133,6 +163,25 @@ jobs:
name: test_network_runs
path: ${{ env.TEST_NETWORK_TMP_DIR }}/irohad_test_network_*

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