Squashed commit of the following: #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: # Run when manually triggered | |
workflow_call: # Run when called by another workflow | |
name: ✔ Validate Code | |
jobs: | |
fmt: | |
name: 📑 Rustfmt Job | |
if: | | |
!startsWith(github.event.head_commit.message, 'ci:') | |
&& !startsWith(github.event.head_commit.message, 'ci(') | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🎟 Checkout Git Repository Step | |
id: repository_checkout_step | |
uses: actions/checkout@v4 | |
- name: 🧰 Install Rust Toolchain Step | |
id: toolchain_install_step | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- name: 🗂 Setup Cargo Cache Step | |
id: cache_setup_step | |
uses: actions/cache@v4 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: 📑 Cargo Fmt | |
id: cargo_fmt_step | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --verbose -- --check | |
clippy: | |
name: 📎 Clippy Job | |
if: | | |
!startsWith(github.event.head_commit.message, 'ci:') | |
&& !startsWith(github.event.head_commit.message, 'ci(') | |
&& !startsWith(github.event.head_commit.message, 'style:') | |
&& !startsWith(github.event.head_commit.message, 'style(') | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-pc-windows-msvc | |
- x86_64-apple-darwin | |
- aarch64-unknown-linux-gnu | |
# - aarch64-apple-darwin | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
# - target: aarch64-apple-darwin | |
# os: macos-latest | |
continue-on-error: true | |
runs-on: ${{ matrix.os }} | |
env: | |
IS_CROSS: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} | |
steps: | |
- name: 🎟 Checkout Git Repository Step | |
id: repository_checkout_step | |
uses: actions/checkout@v4 | |
- name: 🧰 Install Rust Toolchain | |
id: toolchain_install_step | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: clippy | |
- name: 🗂 Setup Cargo Cache Step | |
id: cache_setup_step | |
uses: actions/cache@v4 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: 📎 Clippy | |
id: clippy_step | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
use-cross: ${{ env.IS_CROSS }} | |
args: --workspace --target ${{ matrix.target }} -- -D warnings | |
check: | |
name: ✅ Check Job | |
if: | | |
!startsWith(github.event.head_commit.message, 'ci:') | |
&& !startsWith(github.event.head_commit.message, 'ci(') | |
&& !startsWith(github.event.head_commit.message, 'docs:') | |
&& !startsWith(github.event.head_commit.message, 'docs(') | |
&& !startsWith(github.event.head_commit.message, 'style:') | |
&& !startsWith(github.event.head_commit.message, 'style(') | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-pc-windows-msvc | |
- x86_64-apple-darwin | |
- aarch64-unknown-linux-gnu | |
# - aarch64-apple-darwin | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
# - target: aarch64-apple-darwin | |
# os: macos-latest | |
runs-on: ${{ matrix.os }} | |
env: | |
IS_CROSS: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} | |
steps: | |
- name: 🎟 Checkout Git Repository Step | |
id: repository_checkout_step | |
uses: actions/checkout@v4 | |
- name: 🧰 Install Rust Toolchain Step | |
id: toolchain_install_step | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: ${{ matrix.target }} | |
- name: 🗂 Setup Cargo Cache Step | |
id: cache_setup_step | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: ✅ Cargo Check Step | |
id: cargo_check_step | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
use-cross: ${{ env.IS_CROSS }} | |
args: --workspace --target ${{ matrix.target }} | |
test: | |
name: 🧪 Test | |
if: | | |
!startsWith(github.event.head_commit.message, 'ci:') | |
&& !startsWith(github.event.head_commit.message, 'ci(') | |
&& !startsWith(github.event.head_commit.message, 'docs:') | |
&& !startsWith(github.event.head_commit.message, 'docs(') | |
&& !startsWith(github.event.head_commit.message, 'style:') | |
&& !startsWith(github.event.head_commit.message, 'style(') | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-pc-windows-msvc | |
- x86_64-apple-darwin | |
- aarch64-unknown-linux-gnu | |
# - aarch64-apple-darwin | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
# - target: aarch64-apple-darwin | |
# os: macos-latest | |
runs-on: ${{ matrix.os }} | |
env: | |
IS_CROSS: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} | |
steps: | |
- name: 🎟 Checkout Git Repository | |
id: checkout_repository_step | |
uses: actions/checkout@v2 | |
- name: 🧰 Install Rust Toolchain | |
id: toolchain_install_step | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: ${{ matrix.target }} | |
- name: 🗂 Setup Cargo Cache Step | |
id: cache_setup_step | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: 🧪 Cargo Test | |
id: cargo_test_step | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
use-cross: ${{ env.IS_CROSS }} | |
args: --workspace --target ${{ matrix.target }} |