From 89fb0c2dd6bc44064a588f5e2c1e397cbfb83d42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= <73768+dato@users.noreply.github.com>
Date: Tue, 30 Nov 2021 05:20:00 -0300
Subject: [PATCH] Add workflow to also run tests on a Debian container

This runs tests against Debian stable (bullseye) and, once rocksdb
6.25 makes it out of experimental, against bookworm too (testing).
---
 .github/workflows/build.yml  |  3 +++
 .github/workflows/debian.yml | 42 ++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 .github/workflows/debian.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f637027..a40b203 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,7 +2,10 @@
 name: 'Build'
 
 on:
+  pull_request:
   push:
+    branches:
+      - main
 
 jobs:
   # Build the RocksDB C library and cache the result.
diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml
new file mode 100644
index 0000000..2a7c68d
--- /dev/null
+++ b/.github/workflows/debian.yml
@@ -0,0 +1,42 @@
+name: debian
+
+on:
+  pull_request:
+  push:
+    branches:
+      - main
+      - workflows/debian  # For debugging.
+
+jobs:
+  debian-build:
+    name: ${{ matrix.dist }}
+    runs-on: ubuntu-latest
+    container: debian:${{ matrix.dist }}-slim
+    strategy:
+      fail-fast: false
+      matrix:
+        dist: [bullseye, bookworm]
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Install build-dependencies
+        # TODO(dato): find out why setup.py links to compression libraries
+        # by hand (and hence their development packages needed here).
+        run: |
+          apt-get update
+          apt-get install --no-install-recommends -y \
+              build-essential librocksdb-dev cython3 \
+              python3-dev python3-pip python3-pytest \
+              libsnappy-dev libbz2-dev liblz4-dev libz-dev
+
+      - name: Symlink pytest
+        run: |
+          ln -s /usr/bin/pytest-3 /usr/local/bin/pytest
+
+      - name: Build pyrocksdb
+        run: |
+          python3 -m pip install '.[test]'
+
+      - name: Run tests
+        run: |
+          pytest --pyargs rocksdb
-- 
GitLab