Template
Compare commits
5
Commits
master
...
c45bc81bf8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c45bc81bf8 | ||
|
|
123c9a1da8 | ||
|
|
f2c0af5775 | ||
|
|
b408028c87 | ||
|
|
5a4191bb60 |
@@ -0,0 +1,113 @@
|
||||
name: Crossplatform Linting && Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Linting
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@1.90.0
|
||||
with:
|
||||
targets: x86_64-pc-windows-gnu aarch64-apple-darwin aarch64-unknown-linux-gnu x86_64-unknown-linux-musl aarch64-unknown-linux-musl
|
||||
|
||||
- name: Install cargo sort
|
||||
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
|
||||
with:
|
||||
tool: cargo-sort@1.0.9
|
||||
|
||||
- name: Install cargo machete
|
||||
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
|
||||
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-
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --check
|
||||
|
||||
- name: Check import sorting
|
||||
run: cargo sort --grouped --check --check-format
|
||||
|
||||
- name: Check for unused dependencies
|
||||
run: cargo machete
|
||||
|
||||
- name: Clippy for Linux x86 (GNU and MUSL)
|
||||
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
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@1.90.0
|
||||
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-
|
||||
|
||||
- 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
|
||||
|
||||
- name: Build for Linux aarch64 (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
|
||||
|
||||
|
||||
Generated
+7
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "workflows"
|
||||
version = "0.1.0"
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "temp"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
Reference in New Issue
Block a user