From 781610484940eed2748b0f0e84a94e3fa979012c Mon Sep 17 00:00:00 2001 From: Hendrik van Antwerpen Date: Tue, 5 Dec 2023 17:00:29 +0100 Subject: [PATCH] Add CI --- .github/CODEOWNERS | 1 + .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/ci.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..c7435b5 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @aneubeck @gorzell \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6b01e35 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + merge_group: + push: + +permissions: + contents: read + packages: read + +# In the event that there is a new push to the ref, cancel any running jobs because there are now obsolete, and wasting +# resources. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build & Test + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Install Rust environment + uses: hecrj/setup-rust-action@v1 + with: + rust-version: stable + + - name: Cache Rust dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cargo/ + target/ + key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-cargo- + + - name: Check formatting + run: cargo fmt --all -- --check + + - name: Run test (default features) + run: cargo test + + - name: Run test (all features) + run: cargo test --all-features