Skip to content

Commit 2b3dc33

Browse files
committed
chore: add cross-platform ci
Run linting on Linux and tests on Linux, macOS, and Windows so portability regressions are caught before merge.
1 parent 9050f3e commit 2b3dc33

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ci-${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
CARGO_TERM_COLOR: always
19+
20+
jobs:
21+
lint:
22+
name: Lint
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v4
28+
29+
- name: Install stable Rust toolchain
30+
uses: dtolnay/rust-toolchain@stable
31+
with:
32+
components: rustfmt, clippy
33+
34+
- name: Cache cargo artifacts
35+
uses: Swatinem/rust-cache@v2
36+
37+
- name: Check formatting
38+
run: cargo fmt --all -- --check
39+
40+
- name: Run clippy
41+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
42+
43+
test:
44+
name: Test (${{ matrix.os }})
45+
runs-on: ${{ matrix.os }}
46+
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
os:
51+
- ubuntu-latest
52+
- windows-latest
53+
- macos-latest
54+
55+
steps:
56+
- name: Check out repository
57+
uses: actions/checkout@v4
58+
59+
- name: Install stable Rust toolchain
60+
uses: dtolnay/rust-toolchain@stable
61+
62+
- name: Cache cargo artifacts
63+
uses: Swatinem/rust-cache@v2
64+
65+
- name: Run tests
66+
run: cargo test --workspace

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ If any of these files appear later, treat them as high-priority constraints and
4545
- Run tests and show stdout/stderr: `cargo test --workspace -- --nocapture`
4646
- List discovered tests: `cargo test --workspace -- --list`
4747

48+
### GitHub CI
49+
- Workflow file: `.github/workflows/ci.yml`
50+
- Triggers: pushes to `main`, pull requests, and `workflow_dispatch`
51+
- `lint` job (`ubuntu-latest`):
52+
- `cargo fmt --all -- --check`
53+
- `cargo clippy --workspace --all-targets --all-features -- -D warnings`
54+
- `test` job matrix (`ubuntu-latest`, `windows-latest`, `macos-latest`):
55+
- `cargo test --workspace`
56+
4857
### Running a Single Test (important)
4958
- By substring match: `cargo test -p <package> name_substring`
5059
- Exact unit test name: `cargo test -p <package> exact_test_name -- --exact`
@@ -153,6 +162,7 @@ If one cannot be run locally, explicitly note that in your handoff.
153162
- Format check: `cargo fmt --all -- --check`
154163
- Lint: `cargo clippy --workspace --all-targets --all-features -- -D warnings`
155164
- Test all: `cargo test --workspace`
165+
- GitHub CI workflow: `.github/workflows/ci.yml`
156166
- Test one (substring): `cargo test -p <package> name_substring`
157167
- Test one (exact): `cargo test -p <package> exact_test_name -- --exact`
158168
- List tests: `cargo test --workspace -- --list`

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Gitlane
22

3+
[![CI](https://github.com/chapiteau-team/gitlane/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/chapiteau-team/gitlane/actions/workflows/ci.yml)
4+
35
Gitlane is a Git-native task tracker.
46
All tracker data is stored as Markdown files in the repository.
57

crates/cli/src/path.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ mod tests {
118118
.expect("project config should be created");
119119

120120
gitlane_dir
121+
.canonicalize()
122+
.expect(".gitlane path should canonicalize")
121123
}
122124

123125
#[test]

0 commit comments

Comments
 (0)