Skip to content
Merged
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: FreeBSD

on:
push:
branches:
- '**'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: cpa.sh {0}
steps:
- uses: actions/checkout@v6
- uses: cross-platform-actions/action@v1.2.0
with:
operating_system: freebsd
version: '15.0'
memory: 2G
- name: Install dependencies
run: sudo pkg install -y devel/readline devel/ncurses databases/postgresql18-client meson ninja pkgconf
- name: Configure Meson
run: meson setup build
- name: Build
run: meson compile -C build
- name: Test
run: build/pspg --info
31 changes: 31 additions & 0 deletions .github/workflows/haiku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Haiku

on:
push:
branches:
- '**'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: cpa.sh {0}
steps:
- uses: actions/checkout@v6
- uses: cross-platform-actions/action@v1.2.0
with:
operating_system: haiku
version: r1beta5
memory: 2G
- name: Install dependencies
# newer PG ports miss pg_hmac_create and pg_tolower that somehow get pulled in :(
# also https://github.com/haikuports/haikuports/pull/12892#issuecomment-3248334462
run: pkgman install -y pkgconfig meson readline ncurses6_devel postgresql11_devel
- name: Configure Meson
run: meson setup build
- name: Build
run: meson compile -C build
- name: Test
run: build/pspg --info
34 changes: 25 additions & 9 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
name: build Linux
name: Ubuntu Linux

on:
push:
branches: [ "master" ]
branches:
- '**'
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: configure
run: ./configure
- name: make
run: make

- uses: actions/checkout@v6
- name: Install dependencies
run: >-
sudo apt-get install -qq -y -o=Dpkg::Use-Pty=0
gcc
meson-1.7
ninja-build
libpq-dev
libncurses-dev
libreadline-dev
- name: Configure Meson
run: meson setup build --backend ninja --buildtype release
- name: Build
run: meson compile -C build
- name: Test
run: build/pspg --info
- name: Upload Meson log
uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: Meson log
path: build/meson-logs/meson-log.txt
37 changes: 37 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: macOS

on:
push:
branches:
- '**'
pull_request:

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v6
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
brew install meson
# libpq
# readline
# ncurses
- name: Configure Meson
env:
PKG_CONFIG_PATH: /opt/homebrew/opt/readline/lib/pkgconfig:/opt/homebrew/opt/libpq/lib/pkgconfig
run: meson setup build --backend ninja
- name: Build
run: meson compile -C build
- name: Test
run: build/pspg --info
- name: Upload Meson log
uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: Meson log
path: build/meson-logs/meson-log.txt
82 changes: 82 additions & 0 deletions .github/workflows/windows-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Semi-static on Windows w/ CLANG64

on:
release:
types: [published]
push:
branches:
- '**'
pull_request:

jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: bash
env:
PKG_CONFIG_PATH: C:\msys64\clang64\lib\pkgconfig
MSYSTEM: CLANG64
MINGW_PREFIX: /clang64
steps:
- uses: actions/checkout@v6
- name: Cache downloaded Pacman packages
uses: actions/cache@v5
with:
path: C:\msys64\var\cache\pacman\pkg
key: pacman-win-static
- name: Add MSYS2 to PATH
shell: pwsh
run: |
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\msys64\clang64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install dependencies
run: >-
pacman --noconfirm -S
mingw-w64-clang-x86_64-clang
mingw-w64-clang-x86_64-meson
mingw-w64-clang-x86_64-ninja
mingw-w64-clang-x86_64-pkgconf
mingw-w64-clang-x86_64-postgresql
mingw-w64-clang-x86_64-pdcurses
mingw-w64-clang-x86_64-upx
- name: Configure Meson
run: >-
meson setup build
-Dshlibs=pg -Ddep_prefix=$MINGW_PREFIX
-Dc_link_args="-s -Wl,--delayload=libpq.dll"
--buildtype=minsize -Db_ndebug=true -Ddebug=false
- name: Build
run: meson compile -C build
- name: Test
run: build/pspg.exe --info
- name: Compress binary with UPX
run: upx --best --ultra-brute -o build/pspg_upx.exe build/pspg.exe
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: pspg-windows-binary
path: build/pspg*.exe
- name: Upload Meson log
uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: Meson log
path: build/meson-logs/meson-log.txt

upload-release:
if: github.event_name == 'release'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download built binaries
uses: actions/download-artifact@v6
with:
name: pspg-windows-binary
path: dist
- name: Upload assets to release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" dist/pspg*.exe --clobber --repo "${{ github.repository }}"
55 changes: 55 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: MSVC & ClangCL

on:
push:
branches:
- '**'
pull_request:

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v6

- name: Cache Vcpkg
uses: actions/cache@v5
with:
path: vcpkg_installed
key: vcpkg

- name: Install Meson
run: |
winget install -e --id mesonbuild.meson --silent --accept-source-agreements --accept-package-agreements
echo "C:\Program Files\Meson" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: MSVC environment
uses: ilammy/msvc-dev-cmd@v1

- name: Install Vcpkg dependencies
run: C:\vcpkg\vcpkg.exe install --vcpkg-root=C:\vcpkg

- name: Configure Meson
env:
CC: clang-cl
# --genvslite vs2022
run: >-
meson setup build --backend vs
-Dpgroot="C:\Program Files\PostgreSQL\17" -Ddep_prefix=vcpkg_installed/x64-windows

- name: Build
run: meson compile -C build

- name: Test
env:
PATH: "${{ github.workspace }}/vcpkg_installed/x64-windows/bin;C:/Program Files/PostgreSQL/17/bin;$env:PATH"
run: |
echo $env:PATH
build\pspg.exe --info

- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: Windows shlibs
path: build/RelWithDebInfo/*
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ pspg
/config.cache
/config.log
/config.status
/config.make
/config.make

/build
/vcpkg_installed
Loading
Loading