Skip to content

Commit dcd1d2a

Browse files
committed
Fixes to packages & GitHub Action
Signed-off-by: stavrosvl7 <stavrosvl7@gmail.com>
1 parent cd7b554 commit dcd1d2a

11 files changed

Lines changed: 34 additions & 11 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
# just remove katex-header.html at the root and RUSTDOCFLAGS here
3232
# TODO(template) update the crate name
3333
- name: Build documentation
34-
run: RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps -p template-crate
34+
run: RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps -p template_crate
3535

3636
- name: Remove lock file
3737
run: rm target/doc/.lock

.github/workflows/semver-checks.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,42 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

9+
# Limit permissions to minimum required
10+
permissions:
11+
contents: read
12+
913
env:
1014
CARGO_TERM_COLOR: always
1115
CARGO_INCREMENTAL: 0
1216

1317
jobs:
1418
semver:
1519
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
1622
steps:
1723
- uses: actions/checkout@v4
1824
with:
1925
# cargo-semver-checks needs the full git history to compare versions
2026
fetch-depth: 0
2127

28+
- name: Install Rust toolchain
29+
uses: dtolnay/rust-toolchain@stable
30+
31+
- name: Cache cargo registry
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.cargo/registry/index/
36+
~/.cargo/registry/cache/
37+
~/.cargo/git/db/
38+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-cargo-
41+
2242
- name: Check semver compatibility
23-
uses: obi1kenobi/cargo-semver-checks-action@v2
24-
43+
# Pinned to v2.8: https://github.com/obi1kenobi/cargo-semver-checks-action/releases/tag/v2.8
44+
uses: obi1kenobi/cargo-semver-checks-action@5b298c9520f7096a4683c0bd981a7ac5a7e249ae
45+
with:
46+
# Optional: customize behavior
47+
verbose: true

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ After cloning the repository, follow the instructions below to run the documenta
3030
cargo doc
3131
```
3232

33-
Docs for `TODO(template) template-crate`:
33+
Docs for `TODO(template) template_crate`:
3434

3535
```sh
36-
RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps -p template-crate --open
36+
RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps -p template_crate --open
3737
```

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
# TODO(template) update for the crate name
33
[workspace]
4-
members = ["examples", "template-crate"]
4+
members = ["examples", "template_crate"]
55
resolver = "2"
6-
default-members = ["template-crate"]
6+
default-members = ["template_crate"]
77

88
[workspace.package]
99
version = "0.1.0"

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ license.workspace = true
88

99
[dependencies]
1010
# TODO(template) update the crate name
11-
mycrate = { path = "../mycrate" }
11+
template_crate = { path = "../template_crate" }

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ To run an example
99
cargo run -p examples --bin addition
1010
```
1111

12-
* `addition` - shows how to add two bounded integers with the [`mycrate`](../mycrate/) library.
12+
* `addition` - shows how to add two bounded integers with the [`template_crate`](../template_crate/) library.

examples/src/bin/addition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// TODO(template) - remove/change the code below and rename the example
2-
use mycrate::add_small_integers;
2+
use template_crate::add_small_integers;
33

44
fn main() {
55
println!("{:?}", add_small_integers(6, 8));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
# TODO(template) rename
3-
name = "template-crate"
3+
name = "template_crate"
44
version.workspace = true
55
edition.workspace = true
66
repository.workspace = true
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)