Skip to content

Commit 8c99c31

Browse files
authored
Add Taskfile (#124)
1 parent 6eedafa commit 8c99c31

File tree

3 files changed

+62
-10
lines changed

3 files changed

+62
-10
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ jobs:
2727
runs-on: ${{ matrix.os }}
2828

2929
steps:
30-
- uses: actions/checkout@v3.0.2
30+
- uses: actions/checkout@v3
3131

32-
- uses: actions-rs/toolchain@v1.0.7
32+
- uses: arduino/setup-task@v1
33+
34+
- uses: actions-rs/toolchain@v1
3335
with:
3436
profile: minimal
3537
toolchain: nightly
@@ -40,7 +42,7 @@ jobs:
4042
with:
4143
key: build
4244

43-
- run: cargo build --all-features --locked --release
45+
- run: task build:release
4446

4547
- name: Upload artifacts
4648
uses: actions/upload-artifact@v3
@@ -58,9 +60,11 @@ jobs:
5860
runs-on: ${{ matrix.os }}
5961

6062
steps:
61-
- uses: actions/checkout@v3.0.2
63+
- uses: actions/checkout@v3
64+
65+
- uses: arduino/setup-task@v1
6266

63-
- uses: actions-rs/toolchain@v1.0.7
67+
- uses: actions-rs/toolchain@v1
6468
with:
6569
profile: minimal
6670
toolchain: nightly
@@ -71,24 +75,25 @@ jobs:
7175
with:
7276
key: test
7377

74-
- run: cargo test --all-features -- --nocapture
78+
- run: task test -- --nocapture
7579

7680
clippy:
7781
runs-on: ubuntu-latest
7882

7983
steps:
80-
- uses: actions/checkout@v3.0.2
84+
- uses: actions/checkout@v3
85+
86+
- uses: arduino/setup-task@v1
8187

82-
- uses: actions-rs/toolchain@v1.0.7
88+
- uses: actions-rs/toolchain@v1
8389
with:
8490
profile: minimal
8591
toolchain: nightly
8692
override: true
8793
components: rustfmt, clippy
8894

89-
- run: cargo fmt --all -- --check
95+
- run: task format -- --check
9096

9197
- uses: actions-rs/clippy-check@v1
9298
with:
9399
token: ${{ secrets.GITHUB_TOKEN }}
94-
args: --all-features

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
2+
.task
23
/target
34
integration

Taskfile.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: 3
2+
3+
tasks:
4+
lint:
5+
desc: Lint code
6+
cmds:
7+
- cargo clippy
8+
lint:fix:
9+
desc: Lint code
10+
cmds:
11+
- cargo clippy --fix --allow-staged --allow-dirty
12+
13+
format:
14+
desc: Format code
15+
cmds:
16+
- cargo fmt --all
17+
18+
test:
19+
desc: Run tests
20+
sources:
21+
- Cargo.*
22+
- src/**
23+
- test-data/**
24+
- tests/**
25+
cmds:
26+
- cargo test
27+
28+
build:
29+
desc: Build debug artifacts
30+
sources:
31+
- Cargo.*
32+
- src/**
33+
generates:
34+
- target/debug/**
35+
cmds:
36+
- cargo build
37+
38+
build:release:
39+
desc: Build release artifacts
40+
sources:
41+
- Cargo.*
42+
- src/**
43+
generates:
44+
- target/release/**
45+
cmds:
46+
- cargo build --release --locked

0 commit comments

Comments
 (0)