Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/reusable_extension_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
pg-version: ["14", "15", "16", "17", "18", "19"]

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Nix
uses: cachix/install-nix-action@c134e4c9e34bac6cab09cf239815f9339aaaf84e # v31.5.1

- name: Use Cachix Cache
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
with:
name: nxpg
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Build
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} build"

- name: Run tests
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} test"


test-on-macos:
runs-on: macos-26
strategy:
matrix:
pg-version: ["17"]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Install Nix
uses: cachix/install-nix-action@c134e4c9e34bac6cab09cf239815f9339aaaf84e # v31.5.1
with:
nix_path: nixpkgs=channel:nixos-unstable # needed to solve a bash error on CI

- name: Use Cachix Cache
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
with:
name: nxpg
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: clang analyze
run: |
nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "CPPFLAGS='--analyze -Xanalyzer -analyzer-werror' xpg -v ${{ matrix.pg-version }} build"
rm -rf ./build-${{ matrix.pg-version }}
Comment on lines +49 to +52

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we what we should do instead is to encapsulate most of the logic independent from CI, like this one here could be a Makefile target (which aligns with #12).


- name: Build
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} build"

- name: Run tests
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} test"

coverage:
runs-on: ubuntu-latest

strategy:
matrix:
pg-version: ["17"]

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Nix
uses: cachix/install-nix-action@c134e4c9e34bac6cab09cf239815f9339aaaf84e # v31.5.1

- name: Use Cachix Cache
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
with:
name: nxpg
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Coverage
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} coverage"

- name: Send coverage to Coveralls
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files: ./build-${{ matrix.pg-version }}/coverage.info
Loading