Skip to content

Commit ff96949

Browse files
committed
Added: Configures CI workflow for cross-platform builds
Adds a comprehensive CI workflow using GitHub Actions to enable cross-platform builds for Linux, macOS, and Windows. This configuration includes: - Setting up Rust toolchains for different target architectures. - Installing necessary tools like `just`, `Node.js`, and `jq`. - Running CI checks on Linux and macOS. - Building and testing on Windows. - Enforcing LF line endings for Rust files. The previous CI configuration has been replaced with the new workflow.
1 parent f874ff7 commit ff96949

3 files changed

Lines changed: 54 additions & 10 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Enforce LF line endings for Rust sources across all platforms.
2+
# This keeps `rustfmt.toml`'s `newline_style = "Unix"` from failing on Windows.
3+
*.rs text eol=lf

.github/workflows/ci.yml

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,68 @@ env:
2323
RUST_BACKTRACE: 1
2424

2525
jobs:
26-
test:
26+
build:
2727
runs-on: ${{ matrix.os }}
2828
strategy:
29-
fail-fast: false
29+
fail-fast: false # Continue other jobs if one fails
3030
matrix:
3131
os:
3232
- ubuntu-latest
3333
- macos-latest
3434
- windows-latest
35+
include:
36+
- os: ubuntu-latest
37+
target: x86_64-unknown-linux-gnu
38+
- os: macos-latest
39+
target: x86_64-apple-darwin
40+
- os: windows-latest
41+
target: x86_64-pc-windows-msvc
3542

3643
steps:
3744
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3845

3946
- name: Install Rust toolchain
4047
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
4148
with:
42-
cache: true # toolchain/components are specified in rust-toolchain.toml
49+
target: ${{ matrix.target }}
50+
cache: true # Built-in caching; toolchain/components are specified in rust-toolchain.toml
4351

44-
- name: Rustfmt
45-
run: cargo fmt --check
52+
- name: Install just
53+
if: matrix.os != 'windows-latest'
54+
uses: taiki-e/install-action@50708e9ba8d7b6587a2cb575ddaa9a62e927bc06 # v2.62.63
55+
with:
56+
tool: just
57+
58+
- name: Install Node.js (for markdownlint and cspell)
59+
if: matrix.os != 'windows-latest'
60+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
61+
with:
62+
node-version: '20'
63+
64+
- name: Install Node.js packages
65+
if: matrix.os != 'windows-latest'
66+
run: |
67+
npm install -g markdownlint-cli cspell
68+
69+
- name: Install jq (Linux)
70+
if: matrix.os == 'ubuntu-latest'
71+
run: |
72+
sudo apt-get update
73+
sudo apt-get install -y jq
74+
75+
- name: Install jq (macOS)
76+
if: matrix.os == 'macos-latest'
77+
run: |
78+
brew install jq
4679
47-
- name: Clippy
48-
run: cargo clippy --lib --tests --all-features -- -D warnings
80+
- name: Run CI checks (Linux/macOS)
81+
if: matrix.os != 'windows-latest'
82+
run: just ci
4983

50-
- name: Tests
51-
run: cargo test
84+
- name: Build and test (Windows)
85+
if: matrix.os == 'windows-latest'
86+
run: |
87+
cargo build --verbose --all-targets
88+
cargo test --lib --verbose
89+
cargo test --doc --verbose
90+
cargo test --tests --verbose

.markdownlint.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@
77
"MD038": false,
88
"MD041": false,
99
"MD060": false,
10-
"_comment": "MD029 disabled - we prefer manual numbering over lazy numbering (1. 1. 1.) for better readability; MD060 disabled to avoid auto-reformatting tables"
10+
"_comment": {
11+
"note": "MD029 disabled - we prefer manual numbering over lazy numbering (1. 1. 1.) for better readability; MD060 disabled to avoid auto-reformatting tables"
12+
}
1113
}

0 commit comments

Comments
 (0)