Skip to content

Commit 7d035ac

Browse files
committed
Add justfile and basic CI
1 parent ef32c82 commit 7d035ac

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# A few guiding principles.
2+
#
3+
# * Always use actions-rust-lang/setup-rust-toolchain for its built-in caching.
4+
# * Complexity lives in the justfile, this runner is as light as possible.
5+
6+
name: CI
7+
8+
# Run on direct commits to master, including merges, and any pull requests against master.
9+
on:
10+
push:
11+
branches:
12+
- master
13+
pull_request:
14+
branches:
15+
- master
16+
17+
jobs:
18+
# Quick canary of code as well as potential issues with upcoming toolchains.
19+
check:
20+
strategy:
21+
matrix:
22+
toolchain: [stable, beta, nightly]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: extractions/setup-just@v3
27+
- uses: actions-rust-lang/setup-rust-toolchain@v1
28+
with:
29+
toolchain: ${{ matrix.toolchain }}
30+
components: clippy,rustfmt
31+
- run: just check
32+
# Build and test the code across platforms.
33+
test:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: extractions/setup-just@v3
38+
- uses: actions-rust-lang/setup-rust-toolchain@v1
39+
- name: "Run test suite"
40+
run: just test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/target
22
Cargo.lock
3+
!justfile

justfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
check:
2+
cargo fmt -- --check
3+
cargo clippy --all-targets -- -D warnings
4+
cargo check --all-features
5+
6+
# Run a test suite: unit
7+
test:
8+
cargo test
9+
cargo test --doc
10+
cargo test --examples
11+
12+
# Delete unused files or branches: data, lockfile, branches
13+
delete item="branches":
14+
just _delete-{{item}}
15+
16+
_delete-lockfile:
17+
rm -f Cargo.lock
18+
19+
_delete-branches:
20+
git branch --merged | grep -v \* | xargs git branch -d

0 commit comments

Comments
 (0)