Skip to content

Commit

Permalink
CI attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
amunra committed Sep 25, 2024
1 parent 15b1514 commit fde3a93
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 6 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
name: Linting and Formatting (Linux)
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy

- name: Run rustfmt
run: cargo fmt --check

- name: Run clippy (all targets)
run: cargo clippy --all-targets -- -D warnings

- name: Run clippy with no_std
run: cargo clippy --all-targets --features no_std -- -D warnings

build_test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-12]
features: ["", "--features=no_std"]
profile: ["", "--release"]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly

# Build
- name: Build
run: cargo build ${{ matrix.profile }} ${{ matrix.features }}

# Test
- name: Test
run: cargo test ${{ matrix.profile }} ${{ matrix.features }}
6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ name = "alloc-checked"
version = "0.1.0"
edition = "2021"

# This crate requires nightly Rust due to alloc usage and other nightly features
[package.metadata]
rust-version = "nightly"

[package.metadata.docs.rs]
# Specify to use the nightly toolchain for documentation generation
rustdoc-args = ["--cfg", "nightly"]

[features]
# By default, the crate compiles with the `std` feature enabled.
default = []

# The `no_std` feature explicitly disables `std` and enables alloc and hashbrown.
no_std = ["hashbrown"]

[dependencies]
# `hashbrown` is only needed in `no_std` mode, so it's optional.
hashbrown = { version = "0.14", optional = true }

[dev-dependencies]
Expand Down

0 comments on commit fde3a93

Please sign in to comment.