From b8f6a83b67a15dab2291ffa57ca84a45f4816114 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Jul 2022 13:40:16 +0200 Subject: [PATCH 1/2] dont use specific versions in workflow --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64ee277..0061dda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,9 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3.0.2 + - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1.0.7 + - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: nightly @@ -58,9 +58,9 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3.0.2 + - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1.0.7 + - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: nightly @@ -77,9 +77,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.0.2 + - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1.0.7 + - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: nightly From 7cda8e7694d9f6a457c8ff364ea91b381236e18a Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Jul 2022 14:00:55 +0200 Subject: [PATCH 2/2] add taskfile --- .github/workflows/ci.yml | 13 ++++++++---- .gitignore | 1 + Taskfile.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 Taskfile.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0061dda..8411da8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,8 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: arduino/setup-task@v1 + - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -40,7 +42,7 @@ jobs: with: key: build - - run: cargo build --all-features --locked --release + - run: task build:release - name: Upload artifacts uses: actions/upload-artifact@v3 @@ -60,6 +62,8 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: arduino/setup-task@v1 + - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -71,7 +75,7 @@ jobs: with: key: test - - run: cargo test --all-features -- --nocapture + - run: task test -- --nocapture clippy: runs-on: ubuntu-latest @@ -79,6 +83,8 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: arduino/setup-task@v1 + - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -86,9 +92,8 @@ jobs: override: true components: rustfmt, clippy - - run: cargo fmt --all -- --check + - run: task format -- --check - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features diff --git a/.gitignore b/.gitignore index db2327a..a19cb05 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea +.task /target integration diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..0931417 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,46 @@ +version: 3 + +tasks: + lint: + desc: Lint code + cmds: + - cargo clippy + lint:fix: + desc: Lint code + cmds: + - cargo clippy --fix --allow-staged --allow-dirty + + format: + desc: Format code + cmds: + - cargo fmt --all + + test: + desc: Run tests + sources: + - Cargo.* + - src/** + - test-data/** + - tests/** + cmds: + - cargo test + + build: + desc: Build debug artifacts + sources: + - Cargo.* + - src/** + generates: + - target/debug/** + cmds: + - cargo build + + build:release: + desc: Build release artifacts + sources: + - Cargo.* + - src/** + generates: + - target/release/** + cmds: + - cargo build --release --locked