Skip to content

Commit 9b6a32d

Browse files
committed
ci: modernize workflows
1 parent 23ebaf0 commit 9b6a32d

File tree

8 files changed

+235
-0
lines changed

8 files changed

+235
-0
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [lnp-bp, RGB-WG, dr-orlovsky]

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v[0-9]+\.*'
9+
pull_request:
10+
branches:
11+
- master
12+
- develop
13+
- 'v[0-9]+.[0-9]+'
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
18+
jobs:
19+
default:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@stable
24+
- run: cargo check --workspace
25+
no-default:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: dtolnay/rust-toolchain@stable
30+
- run: cargo check --workspace --no-default-features
31+
features:
32+
runs-on: ubuntu-latest
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
feature: [ fs, log ]
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: dtolnay/rust-toolchain@stable
40+
- name: Feature ${{matrix.feature}}
41+
run: cargo check --workspace --no-default-features --features=${{matrix.feature}}
42+
- name: Feature ${{matrix.feature}}
43+
run: cargo check --workspace --features=${{matrix.feature}}
44+
platforms:
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
os: [ ubuntu-22.04, ubuntu-latest, macos-13, macos-latest, windows-2019, windows-latest ]
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: dtolnay/rust-toolchain@stable
53+
- name: Platform ${{matrix.os}}
54+
run: cargo check --workspace --all-features # we skip test targets here to be sure that the main library can be built
55+
toolchains:
56+
runs-on: ubuntu-latest
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
toolchain: [ nightly, beta, stable, 1.76.0 ]
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: dtolnay/rust-toolchain@master
64+
with:
65+
toolchain: ${{matrix.toolchain}}
66+
- name: Toolchain ${{matrix.toolchain}}
67+
run: cargo +${{matrix.toolchain}} check --workspace --all-targets --all-features

.github/workflows/codecov.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Codecov
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v[0-9]+\.*'
9+
pull_request:
10+
branches:
11+
- master
12+
- develop
13+
- 'v[0-9]+.[0-9]+'
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
18+
jobs:
19+
codecov:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@nightly
24+
with:
25+
components: llvm-tools-preview
26+
- uses: taiki-e/install-action@cargo-llvm-cov
27+
- uses: taiki-e/install-action@nextest
28+
- name: Collect coverage data (including doctests)
29+
run: |
30+
cargo +nightly llvm-cov --no-report nextest --workspace --all-features
31+
cargo +nightly llvm-cov --no-report --doc --workspace --all-features
32+
cargo +nightly llvm-cov report --doctests --lcov --output-path lcov.info
33+
- name: Upload coverage data to codecov
34+
uses: codecov/codecov-action@v4
35+
with:
36+
flags: rust
37+
files: lcov.info
38+
fail_ci_if_error: true
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
verbose: true

.github/workflows/lint.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Lints
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
- 'v[0-9]+.[0-9]+'
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
fmt:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: dtolnay/rust-toolchain@nightly
19+
with:
20+
components: rustfmt
21+
- name: Formatting
22+
run: cargo +nightly fmt --all -- --check
23+
clippy:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: dtolnay/rust-toolchain@stable
28+
with:
29+
components: clippy
30+
- name: Formatting
31+
run: cargo clippy --workspace --all-features --all-targets -- -D warnings
32+
doc:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: dtolnay/rust-toolchain@nightly
37+
with:
38+
components: rust-docs
39+
- name: Formatting
40+
run: cargo +nightly doc --workspace --all-features
41+
typos:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: crate-ci/typos@master

.github/workflows/run.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Generate interfaces
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v[0-9]+\.*'
9+
pull_request:
10+
branches:
11+
- master
12+
- develop
13+
- 'v[0-9]+.[0-9]+'
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
18+
jobs:
19+
gen-ifaces:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@stable
24+
- run: cargo run --features fs
25+
- run: git diff | grep -q . && exit 1

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v[0-9]+\.*'
9+
pull_request:
10+
branches:
11+
- master
12+
- develop
13+
- 'v[0-9]+.[0-9]+'
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
18+
jobs:
19+
testing:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ ubuntu-latest, macos-13, macos-latest, windows-latest ]
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: dtolnay/rust-toolchain@stable
28+
- name: Test ${{matrix.os}}
29+
run: cargo test --workspace --all-features --no-fail-fast
30+
wasm-testing:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: dtolnay/rust-toolchain@nightly
35+
- uses: jetli/wasm-pack-action@v0.4.0
36+
- name: Add wasm32 target
37+
run: rustup target add wasm32-unknown-unknown
38+
- name: Test in headless Chrome
39+
run: wasm-pack test --headless --chrome

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ edition = "2021"
1212
license = "Apache-2.0"
1313
readme = "README.md"
1414

15+
[[bin]]
16+
name = "rgb-schemata"
17+
required-features = ["fs"]
18+
1519
[lib]
1620
name = "schemata"
1721

_typos.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[files]
2+
extend-exclude = ["interfaces/"]
3+
4+
[default.extend-words]
5+
# Don't correct the name "Jon Atack".
6+
Atack = "Atack"
7+
8+
[default]
9+
extend-ignore-re = [
10+
# Don't correct URIs
11+
"([a-z]+:)*[$!0-9A-Za-z-]+",
12+
]

0 commit comments

Comments
 (0)