Template
Compare commits
27
Commits
93cc353730
...
156d8858a7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
156d8858a7 | ||
|
|
90728f9f9a | ||
|
|
b988928732 | ||
|
|
4a915b424d | ||
|
|
c88da52222 | ||
|
|
f4ffb73448 | ||
|
|
66e26410fd | ||
|
|
c44e7a07a8 | ||
|
|
a4f927c162 | ||
|
|
dc0fcbc73a | ||
|
|
70c3df4158 | ||
|
|
08ebdbbba2 | ||
|
|
caf76c9cdd | ||
|
|
cdd1fdb9e4 | ||
|
|
ec3cccc79d | ||
|
|
e975046921 | ||
|
|
fcbc750247 | ||
|
|
1255d11675 | ||
|
|
97b66c71e3 | ||
|
|
1e10f21bf2 | ||
|
|
5b69e43593 | ||
|
|
65517ef9bb | ||
|
|
6f0d480492 | ||
|
|
1b2aaee7bc | ||
|
|
c901cdf644 | ||
|
|
e28361f965 | ||
|
|
732b0e8f57 |
@@ -0,0 +1,2 @@
|
||||
[registries.gitea]
|
||||
index = "sparse+https://gitea.example.com/api/packages/crates/cargo/"
|
||||
+57
-66
@@ -15,99 +15,90 @@ jobs:
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@1.90.0
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86-64-pc-windows-gnu aarch64-apple-darwin aarch64-unknown-linux-gnu x86_64-unknown-linux-musl aarch64-unknown-linux-musl
|
||||
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install cargo sort
|
||||
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: cargo-sort@1.0.9
|
||||
tool: cargo-sort
|
||||
|
||||
- name: Install cargo machete
|
||||
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: cargo-machete@0.7.0
|
||||
|
||||
- name: Cache cargo dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-lint-
|
||||
tool: cargo-machete
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --check
|
||||
|
||||
- name: Check import sorting
|
||||
run: cargo sort --grouped --check --check-format
|
||||
run: cargo sort --workspace --grouped --check --check-format
|
||||
|
||||
- name: Check for unused dependencies
|
||||
run: cargo machete
|
||||
|
||||
- name: Clippy for Linux x86 (GNU and MUSL)
|
||||
- name: Clippy for Linux x86 (GNU ONLY)
|
||||
run: |
|
||||
cargo clippy --target x86-64-unknown-linux-gnu -- -D warnings
|
||||
cargo clippy --target x86-64-unknown-linux-musl -- -D warnings
|
||||
|
||||
- name: Clippy for Linux aarch64 (GNU and MUSL)
|
||||
run: |
|
||||
cargo clippy --target aarch-64-unknown-linux-gnu -- -D warnings
|
||||
cargo clippy --target aarch-64-unknown-linux-musl -- -D warnings
|
||||
|
||||
- name: Clippy for x86 Windows
|
||||
run: cargo clippy --target x86-64-pc-windows-gnu -- -D warnings
|
||||
|
||||
- name: Clippy for MacOS aarch64
|
||||
run: cargo clippy --target aarch64-apple-darwin -- -D warnings
|
||||
|
||||
cargo clippy --target x86_64-unknown-linux-gnu -- -D warnings
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
requires: lint
|
||||
needs: lint
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@1.90.0
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86-64-pc-windows-gnu aarch64-apple-darwin aarch64-unknown-linux-gnu x86_64-unknown-linux-musl aarch64-unknown-linux-musl
|
||||
|
||||
- name: Cache cargo dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-lint-
|
||||
|
||||
targets: x86_64-unknown-linux-musl
|
||||
|
||||
- name: Build for Linux x86 (GNU and MUSL)
|
||||
run: |
|
||||
cargo build --target x86-64-unknown-linux-gnu --locked
|
||||
cargo build --target x86-64-unknown-linux-musl --locked
|
||||
cargo build --target x86_64-unknown-linux-gnu --release --locked
|
||||
cargo build --target x86_64-unknown-linux-musl --release --locked
|
||||
|
||||
- name: Build for Linux aarch64 (GNU and MUSL)
|
||||
|
||||
cross_build:
|
||||
name: Cross-Build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint, build]
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Crosscompile for aarch64 linux, windows, macos
|
||||
uses: zijiren233/cargo-cross@v1
|
||||
with:
|
||||
targets: |
|
||||
aarch64-unknown-linux-musl
|
||||
aarch64-unknown-linux-gnu
|
||||
x86_64-pc-windows-gnu
|
||||
aarch64-apple-darwin
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, lint]
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86_64-unknown-linux-musl
|
||||
|
||||
- name: Test for Linux x86 (GNU and MUSL)
|
||||
run: |
|
||||
cargo build --target aarch-64-unknown-linux-gnu --locked
|
||||
cargo build --target aarch-64-unknown-linux-musl --locked
|
||||
|
||||
- name: Build for x86 Windows
|
||||
run: cargo build --target x86-64-pc-windows-gnu --locked
|
||||
|
||||
- name: Build for MacOS aarch64
|
||||
run: cargo build --target aarch64-apple-darwin --locked
|
||||
|
||||
|
||||
cargo test --target x86_64-unknown-linux-gnu --release --locked
|
||||
cargo test --target x86_64-unknown-linux-musl --release --locked
|
||||
|
||||
|
||||
|
||||
Generated
+5
-1
@@ -3,5 +3,9 @@
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "workflows"
|
||||
name = "example_bin"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "example_lib"
|
||||
version = "0.1.0"
|
||||
|
||||
+3
-6
@@ -1,6 +1,3 @@
|
||||
[package]
|
||||
name = "temp"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
[workspace]
|
||||
resolver = "3"
|
||||
members = ["example_bin","example_lib"]
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "example_bin"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "example_lib"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1,14 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user