Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2025 FastLabs Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[alias]
x = "run --package x --"

[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }
97 changes: 58 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
push:
branches: [ main ]

# Concurrency strategy:
# github.workflow: distinguish this workflow from others
Expand All @@ -33,57 +33,76 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Check
runs-on: ubuntu-24.04
env:
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@master
- uses: actions/checkout@v7
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt,clippy
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: typos-cli,taplo-cli,hawkeye
- name: Cargo version
run: cargo --version
- name: Check format
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo clippy --all-targets --all-features -- --deny warnings
- name: Check typos
run: typos
- name: Check taplo
run: taplo check
- name: Run hawkeye
run: hawkeye check
- run: cargo x lint

msrv:
name: Resolve MSRV
runs-on: ubuntu-24.04
outputs:
rust-versions: ${{ steps.metadata.outputs.rust-versions }}
steps:
- uses: actions/checkout@v7
- id: metadata
run: |
msrv=$(yq '.workspace.package.rust-version' Cargo.toml)
echo "MSRV: $msrv"
echo "rust-versions=[\"${msrv}\", \"stable\"]" >> "$GITHUB_OUTPUT"

test:
runs-on: ${{ matrix.os }}
name: Run tests
needs: msrv
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
rust: [ "1.85.0", "stable", "nightly" ]
env:
RUST_BACKTRACE: 1
os: [ ubuntu-24.04, macos-14, windows-2022 ]
rust-version: ${{ fromJson(needs.msrv.outputs.rust-versions) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@master
- name: Delete rust-toolchain.toml
run: rm rust-toolchain.toml
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Cargo version
run: cargo --version
toolchain: ${{ matrix.rust-version }}
- name: Build
run: cargo build --workspace --all-targets
- name: Build Release
run: cargo build --workspace --all-targets --release
- name: Run tests
run: cargo test -- --nocapture
run: cargo x build --locked
shell: bash
- name: Build release
run: cargo x build --locked --release
shell: bash
- name: Run unit tests
run: cargo x test --no-capture
shell: bash

required:
name: Required
runs-on: ubuntu-24.04
if: ${{ always() }}
needs:
- check
- test
steps:
- name: Guardian
run: |
if [[ ! ( \
"${{ needs.check.result }}" == "success" \
&& "${{ needs.test.result }}" == "success" \
) ]]; then
echo "Required jobs haven't been completed successfully."
exit -1
fi
16 changes: 16 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Agent Instructions

## Cargo XTask

Use `cargo x` as the source of truth for repository workflows.

- Run `cargo x --help` before choosing build, test, lint, or formatting commands.
- Run `cargo x <command> --help` for command-specific behavior.

## Commits and Pull Requests

Follow the semantic definition at `.github/semantic.yml`.

- Keep title descriptions short.
- Simple PR descriptions should only include a `Summary` section.
- Complex PR descriptions may also include a `Design Notes` section.
143 changes: 143 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,26 @@
# limitations under the License.

[workspace]
members = ["stacksafe", "stacksafe-macro"]
resolver = "2"
members = ["stacksafe", "stacksafe-macro", "xtask"]
resolver = "3"

[workspace.package]
edition = "2024"
license = "Apache-2.0"
repository = "https://github.com/fast/stacksafe"
rust-version = "1.85.0"
rust-version = "1.88.0"
version = "1.0.3"

[workspace.lints.rust]
unknown_lints = "deny"
unsafe_code = "deny"
unused_must_use = "deny"

[workspace.lints.clippy]
dbg_macro = "deny"
too_many_arguments = "allow"
type_complexity = "allow"

[workspace.dependencies]
# workspace dependencies
stacksafe = { version = "1.0.3", path = "stacksafe" }
Expand Down
Loading
Loading