Skip to content

Commit 7b53131

Browse files
authored
ci: Update workflows for publishing and testing on PRs for consistency and correctness (#1051)
Signed-off-by: Roger Barker <[email protected]>
1 parent cb6a228 commit 7b53131

File tree

8 files changed

+826
-463
lines changed

8 files changed

+826
-463
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
name: "PR Formatting"
3+
on:
4+
pull_request_target:
5+
types:
6+
- assigned
7+
- unassigned
8+
- labeled
9+
- unlabeled
10+
- opened
11+
- reopened
12+
- edited
13+
- converted_to_draft
14+
- ready_for_review
15+
- review_requested
16+
- review_request_removed
17+
- locked
18+
- unlocked
19+
- synchronize
20+
21+
defaults:
22+
run:
23+
shell: bash
24+
25+
permissions:
26+
statuses: write
27+
28+
jobs:
29+
title-check:
30+
name: Title Check
31+
runs-on: hiero-client-sdk-linux-medium
32+
steps:
33+
- name: Harden Runner
34+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
35+
with:
36+
egress-policy: audit
37+
38+
- name: Check PR Title
39+
uses: step-security/conventional-pr-title-action@8a8989588c2547f23167c4c42f0fb2356479e81b # v3.2.1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
assignee-check:
44+
name: Assignee Check
45+
runs-on: hiero-client-sdk-linux-medium
46+
47+
steps:
48+
- name: Harden Runner
49+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
50+
with:
51+
egress-policy: audit
52+
53+
- name: Check Assignee
54+
if: ${{ github.event.pull_request.assignees == null || github.event.pull_request.assignees[0] == null }}
55+
run: |
56+
echo "Assignee is not set. Failing the workflow."
57+
exit 1

.github/workflows/rust-ci.yml renamed to .github/workflows/flow-rust-ci.yaml

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust CI
1+
name: "Flow: Rust CI"
22
on:
33
pull_request:
44
push:
@@ -11,6 +11,9 @@ defaults:
1111
permissions:
1212
contents: read
1313

14+
env:
15+
NODE_VERSION: "20.18.3"
16+
1417
jobs:
1518
format:
1619
runs-on: hiero-client-sdk-linux-medium
@@ -46,31 +49,21 @@ jobs:
4649
with:
4750
egress-policy: audit
4851

49-
- name: Setup NodeJS
50-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
51-
with:
52-
node-version: 18
53-
54-
- name: Setup GCC and OpenSSL
55-
run: |
56-
sudo apt-get update
57-
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev libssl-dev pkg-config openssl
58-
5952
- name: Checkout Code
6053
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6154
with:
6255
submodules: 'recursive'
6356

64-
- name: Rust Cache
65-
uses: step-security/rust-cache@94e3ae6a5bdb04807deb1cb2274adab839828881 # v2.8.0
57+
- name: Setup Rust
58+
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # v1
6659
with:
67-
workspaces: |
68-
sdk/rust
60+
toolchain: 1.88.0
6961

70-
- name: Install pkg-config
62+
- name: Setup GCC and OpenSSL
7163
run: |
7264
sudo apt-get update
73-
sudo apt-get install -y pkg-config
65+
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev libssl-dev pkg-config openssl
66+
7467
- name: Install Protoc
7568
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
7669
with:
@@ -91,40 +84,39 @@ jobs:
9184
with:
9285
egress-policy: audit
9386

94-
- name: Setup NodeJS
95-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
96-
with:
97-
node-version: 22
98-
99-
- name: Setup GCC and OpenSSL
100-
run: |
101-
sudo apt-get update
102-
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev libssl-dev pkg-config openssl
103-
10487
- name: Checkout Code
10588
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
10689
with:
10790
submodules: 'recursive'
10891

109-
- name: Rust Cache
110-
uses: step-security/rust-cache@94e3ae6a5bdb04807deb1cb2274adab839828881 # v2.8.0
92+
- name: Setup Rust
93+
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # v1
11194
with:
112-
workspaces: |
113-
.
95+
toolchain: 1.88.0
96+
97+
- name: Setup GCC and OpenSSL
98+
run: |
99+
sudo apt-get update
100+
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev libssl-dev pkg-config openssl
114101
115102
- name: Install Protoc
116103
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
117104
with:
118105
repo-token: ${{ secrets.GITHUB_TOKEN }}
119106

107+
- name: Setup NodeJS
108+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
109+
with:
110+
node-version: ${{ env.NODE_VERSION }}
111+
120112
- name: Prepare Hiero Solo
121113
id: solo
122114
uses: hiero-ledger/hiero-solo-action@10ec96a107b8d2f5cd26b3e7ab47e65407b5c462 # v0.11.0
123115
with:
124116
installMirrorNode: true
125117
hieroVersion: v0.60.0-alpha.0
126118

127-
- name: "Create env file"
119+
- name: Create env file
128120
run: |
129121
touch .env
130122
echo TEST_OPERATOR_KEY="302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137" >> .env
@@ -137,4 +129,4 @@ jobs:
137129
run: |
138130
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
139131
. $HOME/.cargo/env
140-
cargo test --workspace
132+
cargo test --workspace

0 commit comments

Comments
 (0)