From d41e71917e49b3c9981877ff1f0f323d39f14f91 Mon Sep 17 00:00:00 2001
From: Henry Gressmann <mail@henrygressmann.de>
Date: Mon, 4 Dec 2023 14:06:02 +0100
Subject: [PATCH] ci: add workflow

Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
---
 .github/workflows/test.yaml | 43 +++++++++++++++++++++++++++++++++++++
 1 file changed, 43 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..c4ae296
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,43 @@
+name: Rust CI
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+
+jobs:
+  test-std:
+    name: Test with default features on stable Rust
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Install stable Rust toolchain
+        run: |
+          rustup toolchain install stable
+          rustup default stable
+
+      - name: Build (stable)
+        run: cargo +stable build --verbose
+
+      - name: Run tests (stable)
+        run: cargo +stable test --verbose
+
+  test-no-std:
+    name: Test without default features on nightly Rust
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install nightly Rust toolchain
+        run: |
+          rustup toolchain install nightly
+          rustup default nightly
+
+      - name: Build (nightly, no default features)
+        run: cargo +nightly build --verbose --no-default-features
+
+      - name: Run tests (nightly, no default features)
+        run: cargo +nightly test --verbose --no-default-features