Skip to content

Commit 1565f30

Browse files
feat(ci): add basic workflows (#145)
* feat(ci): add basic workflows * branches: [develop, sdk-bindings] * install dprint * fix cargo deny * install udeps * remove udeps * add deny.toml * add license to FFI crate * add 2 deny ignores * dprint * pin actions * remove schedules * remove comment
1 parent 55191c7 commit 1565f30

File tree

11 files changed

+383
-65
lines changed

11 files changed

+383
-65
lines changed

.github/workflows/bindings.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ on:
1111
types: [opened, synchronize, reopened, ready_for_review]
1212

1313
concurrency:
14-
group: sdk-bindings-${{ github.event.pull_request.number || github.ref }}
14+
group: bindings-${{ github.event.pull_request.number || github.ref }}
1515
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
1616

1717
jobs:
1818
go:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2323
- name: Install uniffi-bindgen-go
2424
run: cargo install uniffi-bindgen-go --git https://github.com/filament-dm/uniffi-bindgen-go --rev ab7315502bd6b979207fdae854e87d531ee8764d
2525
- name: Build the bindings
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- name: Checkout repository
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3636
- name: Build the bindings
3737
run: make kotlin
3838
- name: Checks for uncommitted changes
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Checkout repository
51-
uses: actions/checkout@v4
51+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5252
- name: Build the bindings
5353
run: make python
5454
- name: Checks for uncommitted changes

.github/workflows/dprint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Dprint
2+
3+
on:
4+
push:
5+
branches: [develop, sdk-bindings]
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: dprint-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
RUSTFLAGS: -Dwarnings
19+
20+
jobs:
21+
dprint:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
- name: Install dprint
26+
run: curl -fsSL https://dprint.dev/install.sh | sh
27+
- name: Check dprint formatting
28+
run: ~/.dprint/bin/dprint check

.github/workflows/lints.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Lints
2+
3+
on:
4+
push:
5+
branches: [develop, sdk-bindings]
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: lints-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
RUSTFLAGS: -Dwarnings
19+
20+
jobs:
21+
lint:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27+
28+
- uses: taiki-e/install-action@cargo-hack
29+
30+
- name: Install latest nightly
31+
run: rustup toolchain install nightly --component rustfmt --allow-downgrade
32+
33+
- name: rustfmt
34+
run: make check-fmt
35+
36+
- name: clippy
37+
run: make clippy
38+
39+
- name: rustdoc
40+
run: make doc
41+
42+
- name: feature compatibility
43+
run: make check-features
44+
45+
- run: make is-dirty
46+
47+
cargo-deny:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
51+
- name: Install cargo-deny
52+
run: cargo install cargo-deny
53+
- name: cargo deny (bans, licenses, sources, advisories)
54+
run: cargo deny --manifest-path './Cargo.toml' check bans licenses sources advisories --hide-inclusion-graph
55+
56+
check-unused-deps:
57+
name: Check Unused Dependencies (${{ matrix.flags }})
58+
strategy:
59+
matrix:
60+
flags: ["--all-features", "--no-default-features"]
61+
fail-fast: false
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
65+
- name: Install nightly cargo-udeps
66+
run: cargo +nightly install cargo-udeps
67+
- name: Run Cargo Udeps
68+
run: cargo +nightly udeps ${{ matrix.flags }}

.github/workflows/pr_title.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "PR title"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
- ready_for_review
11+
12+
jobs:
13+
validate:
14+
name: Validate PR title
15+
runs-on: ubuntu-latest
16+
permissions:
17+
pull-requests: read
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
20+
with:
21+
types: |
22+
feat
23+
fix
24+
refactor
25+
chore
26+
upstream
27+
requireScope: false
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rustdoc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: rustdoc
22

33
on:
44
push:
5-
branches: [develop]
5+
branches: [develop, sdk-bindings]
66
workflow_dispatch:
77

88
env:
@@ -16,13 +16,13 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2020

2121
- name: rustdoc
2222
run: make doc
2323

2424
- name: Deploy Docs
25-
uses: peaceiris/actions-gh-pages@v3
25+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
2626
with:
2727
github_token: ${{ secrets.GITHUB_TOKEN }}
2828
publish_branch: gh-pages
Lines changed: 18 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: CI
1+
name: Tests
22

33
on:
44
push:
5-
branches: [develop]
5+
branches: [develop, sdk-bindings]
66
pull_request:
77
types: [opened, synchronize, reopened, ready_for_review]
88
workflow_dispatch:
99
schedule: [cron: "40 1 * * *"]
1010

1111
concurrency:
12-
group: ci-${{ github.event.pull_request.number || github.ref }}
12+
group: tests-${{ github.event.pull_request.number || github.ref }}
1313
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
1414

1515
permissions:
@@ -19,12 +19,12 @@ env:
1919
RUSTFLAGS: -Dwarnings
2020

2121
jobs:
22-
test:
22+
tests:
2323
runs-on: ubuntu-latest
2424

2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2828

2929
- name: rust version
3030
run: |
@@ -36,55 +36,7 @@ jobs:
3636
- name: Run tests
3737
run: make test
3838

39-
lint:
40-
runs-on: ubuntu-latest
41-
42-
steps:
43-
- name: Checkout repository
44-
uses: actions/checkout@v4
45-
46-
- uses: taiki-e/install-action@cargo-hack
47-
48-
- name: Install latest nightly
49-
run: rustup toolchain install nightly --component rustfmt --allow-downgrade
50-
51-
- name: rustfmt
52-
run: make check-fmt
53-
54-
- name: clippy
55-
run: make clippy
56-
57-
- name: rustdoc
58-
run: make doc
59-
60-
- name: feature compatibility
61-
run: make check-features
62-
63-
- run: make is-dirty
64-
65-
wasm:
66-
runs-on: ubuntu-latest
67-
68-
steps:
69-
- name: Checkout repository
70-
uses: actions/checkout@v4
71-
72-
- name: rust version
73-
run: |
74-
rustc --version
75-
cargo --version
76-
77-
- uses: taiki-e/install-action@wasm-pack
78-
79-
- name: Install clang
80-
run: sudo apt-get install -y clang
81-
82-
- name: Run tests in wasm
83-
run: RUSTFLAGS='-Dwarnings --cfg getrandom_backend="wasm_js"' make wasm
84-
85-
- run: make is-dirty
86-
87-
run_tests_with_network:
39+
tests-with-network:
8840
runs-on: ubuntu-latest
8941
env:
9042
EPOCH_DURATION_MS: 10000
@@ -105,7 +57,7 @@ jobs:
10557
- 5432:5432
10658
steps:
10759
- name: Checkout repository
108-
uses: actions/checkout@v4
60+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
10961

11062
- name: rust version
11163
run: |
@@ -136,3 +88,14 @@ jobs:
13688
run: |
13789
sleep $((EPOCH_DURATION_MS / 1000)) # wait for the network to get to epoch #2
13890
make test-with-localnet
91+
92+
doctests:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
96+
- name: doctests
97+
run: |
98+
cargo test --doc
99+
- name: rustdoc
100+
run: |
101+
cargo doc --all-features --workspace --no-deps

.github/workflows/typos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1919
- name: Install typos-cli
2020
run: cargo install typos-cli
2121
- name: Run typos-cli

.github/workflows/wasm.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: WASM
2+
3+
on:
4+
push:
5+
branches: [develop, sdk-bindings]
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: wasm-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
RUSTFLAGS: -Dwarnings
19+
20+
jobs:
21+
wasm:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27+
28+
- name: rust version
29+
run: |
30+
rustc --version
31+
cargo --version
32+
33+
- uses: taiki-e/install-action@wasm-pack
34+
35+
- name: Install clang
36+
run: sudo apt-get install -y clang
37+
38+
- name: Run tests in wasm
39+
run: RUSTFLAGS='-Dwarnings --cfg getrandom_backend="wasm_js"' make wasm
40+
41+
- run: make is-dirty

crates/iota-graphql-client/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description = "GraphQL RPC Client for the IOTA Blockchain"
1010

1111
[dependencies]
1212
anyhow = "1.0.71"
13-
async-stream = "0.3.3"
14-
async-trait = "0.1.61"
1513
base64ct = { version = "1.6.0", features = ["alloc", "std"] }
1614
bcs = "0.1.4"
1715
chrono = "0.4.26"

crates/iota-sdk-ffi/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[package]
22
name = "iota-sdk-ffi"
33
version = "0.0.1"
4+
authors = ["IOTA Foundation <[email protected]>"]
45
edition = "2024"
6+
license = "Apache-2.0"
57

68
[[bin]]
79
name = "iota_sdk_bindings"

0 commit comments

Comments
 (0)