From 7d742a9df6e2651aefd7d55cb054e1dea85af7ff Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Fri, 12 Apr 2024 15:08:41 +0200 Subject: [PATCH] ci: add basic cargo test/clippy --- .github/workflows/test.yaml | 53 +++++++++++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..297f8f7 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,53 @@ +name: Continuous integration + +on: + - push + - pull_request + +jobs: + changelog: + name: Changelog + runs-on: ubuntu-latest + + outputs: + changelog: ${{ steps.changed-files.outputs.all_changed_files }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v42.0.2 + + run_unitary_tests: + name: Run clippy and unitary tests + runs-on: ubuntu-latest + + needs: changelog + if: | + contains(needs.changelog.outputs.changelog, 'src') || + contains(needs.changelog.outputs.changelog, 'Cargo.toml') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + + - name: Cargo clippy + uses: actions-rs/clippy@master + + - name: Cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --verbose diff --git a/README.md b/README.md index bfcc2ca..aaca77e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Continuos Integration](https://github.com/rogercoll/pid-set/actions/workflows/test.yaml//badge.svg?branch=main)](https://github.com/rogercoll/pid-set/actions/workflows/test.yaml?query=branch%3Amain) +[![dependency status](https://deps.rs/repo/github/rogercoll/pid-set/status.svg)](https://deps.rs/repo/github/rogercoll/pid-set) + # PID Set Library The `pid_set` library provides tools for managing and monitoring process identifiers (PIDs) using epoll on Linux platforms. It utilizes epoll and pidfd to asynchronously notify when a process exits, offering a robust way to handle PID-related events.