Skip to content

specified nightly version #35

specified nightly version

specified nightly version #35

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 }}