Run build and test as postgres user
authorChristoph Berg <myon@debian.org>
Tue, 4 Jun 2024 13:35:36 +0000 (15:35 +0200)
committerChristoph Berg <myon@debian.org>
Tue, 4 Jun 2024 14:08:17 +0000 (16:08 +0200)
GH actions run as root by default which initdb doesn't like.

.github/workflows/ci.yml

index 8112af51c87314fd9cce6008a130b8041781a29f..89c61f7a6ca6635189291221da764352f07f8a8b 100644 (file)
@@ -28,7 +28,9 @@ jobs:
         run: pg-start ${{ matrix.pg }}
       - name: Check out the repo
         uses: actions/checkout@v3
+      - name: Give build directory to postgres
+        run: 'chown -R postgres: .'
       - name: Install extra build dependencies
-        run: sudo apt-get install -y liblz4-dev libipc-run-perl
+        run: apt-get install -y liblz4-dev libipc-run-perl
       - name: Build and test on PostgreSQL ${{ matrix.pg }}
-        run: PATH=$PATH:/usr/lib/postgresql/${{ matrix.pg }}/bin pg-build-test
+        run: sudo -u postgres pg-build-test