Skip to content

Commit 019f027

Browse files
authored
Merge pull request #144 from Apricot-S/develop
v5.0.4
2 parents 22f1291 + 25327cd commit 019f027

File tree

4 files changed

+122
-55
lines changed

4 files changed

+122
-55
lines changed

.github/workflows/ci.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
fmt:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v6
24+
with:
25+
persist-credentials: false
26+
27+
- name: Install Rust
28+
uses: dtolnay/rust-toolchain@stable
29+
30+
- name: Format check
31+
run: cargo fmt -- --check
32+
33+
clippy:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v6
37+
with:
38+
persist-credentials: false
39+
40+
- name: Install Rust
41+
uses: dtolnay/rust-toolchain@stable
42+
43+
- name: Cache cargo
44+
uses: Swatinem/rust-cache@v2
45+
46+
- name: Clippy
47+
run: cargo clippy -- -D warnings
48+
49+
build:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v6
53+
with:
54+
persist-credentials: false
55+
56+
- name: Install Rust
57+
uses: dtolnay/rust-toolchain@stable
58+
59+
- name: Cache cargo
60+
uses: Swatinem/rust-cache@v2
61+
62+
- name: Build
63+
run: cargo build --verbose
64+
65+
- name: Test
66+
run: cargo test --verbose
67+
68+
docs-rs:
69+
name: Documentation
70+
needs: build
71+
runs-on: ubuntu-latest
72+
env:
73+
RUSTDOCFLAGS: -Dwarnings
74+
steps:
75+
- uses: actions/checkout@v6
76+
with:
77+
persist-credentials: false
78+
- uses: dtolnay/rust-toolchain@nightly
79+
- uses: dtolnay/install@cargo-docs-rs
80+
- run: cargo docs-rs
81+
82+
doc:
83+
needs: build
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v6
87+
with:
88+
persist-credentials: false
89+
90+
- name: Run doc
91+
run: cargo doc --no-deps
92+
93+
- name: Deploy
94+
uses: actions/upload-pages-artifact@v4
95+
with:
96+
path: target/doc
97+
98+
deploy:
99+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
100+
needs: doc
101+
permissions:
102+
pages: write
103+
id-token: write
104+
environment:
105+
name: github-pages
106+
url: ${{ steps.deployment.outputs.page_url }}
107+
runs-on: ubuntu-latest
108+
steps:
109+
- name: Deploy to GitHub Pages
110+
id: deployment
111+
uses: actions/deploy-pages@v4

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ on:
66
env:
77
CARGO_TERM_COLOR: always
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
publish:
1114
runs-on: ubuntu-latest
12-
1315
steps:
1416
- uses: actions/checkout@v6
17+
with:
18+
persist-credentials: false
1519

1620
- name: Install Rust
1721
uses: dtolnay/rust-toolchain@stable

.github/workflows/rust.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[package]
22
name = "xiangting"
33
description = "A library for calculating the deficiency number (a.k.a. xiàngtīng number, 向聴数)."
4-
version = "5.0.3"
4+
version = "5.0.4"
55
authors = ["Apricot S."]
66
edition = "2024"
77
rust-version = "1.85"
88
license = "MIT"
99
readme = "README.md"
10+
documentation = "https://docs.rs/xiangting"
1011
repository = "https://github.com/Apricot-S/xiangting"
1112
keywords = ["mahjong", "riichi", "shanten", "xiangting"]
1213
categories = ["algorithms", "no-std"]
@@ -20,12 +21,12 @@ thiserror = { version = "2.0.17", default-features = false }
2021

2122
[dev-dependencies]
2223
criterion = "0.7.0"
23-
cxx = "1.0.186"
24-
rand = "0.9.2"
25-
rand_pcg = "0.9.0"
24+
cxx = "1.0.194"
25+
rand = "0.10.0"
26+
rand_pcg = "0.10.0"
2627

2728
[build-dependencies]
28-
cxx-build = { version = "1.0.186", optional = true }
29+
cxx-build = { version = "1.0.194", optional = true }
2930

3031
[features]
3132
build-file = []

0 commit comments

Comments
 (0)