Skip to content
Open
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
106 changes: 106 additions & 0 deletions .github/workflows/cygwin-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Cygwin

on:
pull_request:
push:
branches:
- master

jobs:
cygwin-build:
runs-on: windows-latest
env:
CYGWIN: winsymlinks:nativestrict

defaults:
run:
# Cygwin-specific shell wrapper to handle path conversions and line endings
shell: >
C:\tools\cygwin\bin\bash.EXE --login -eo pipefail -c
"p=$(/usr/bin/cygpath -au '{0}');
w=$(/usr/bin/cygpath -au '${{ github.workspace }}');
/usr/bin/sed -i 's/\r$//' \"$p\" || true;
set -o igncr;
cd \"$w\" || (/usr/bin/pwd; /usr/bin/ls -la; exit 2);
/usr/bin/bash -leo pipefail \"$p\""
Comment on lines +18 to +25
Copy link
Member

Choose a reason for hiding this comment

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

Most likely a super stupid question: if I look at [0], it seems to me like this solution is convoluted, but I guess there's a simple reason why this is as it is!? Where does this originate from?

[0] https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/set-default-values-for-jobs#setting-default-shell-and-working-directory


steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Cygwin with build dependencies
uses: egor-tensin/setup-cygwin@v4
with:
packages: >-
autoconf
automake
libtool
make
pkg-config
autoconf-archive
gcc-core
gettext-devel
git
libncursesw-devel
libglib2.0-devel
libcurl-devel
libreadline-devel
libsqlite3-devel
libexpat-devel

- name: Build and install libstrophe from source
run: |
cd "$GITHUB_WORKSPACE"
mkdir -p deps && cd deps
git clone --depth 1 https://github.com/strophe/libstrophe.git
cd libstrophe
autoreconf -i
./configure --prefix=$PWD/install
make -j2 install

- name: Verify project configuration
run: |
cd "$GITHUB_WORKSPACE"
# Prevent automatic line ending conversions in Cygwin environment
git config --global core.autocrlf false || true
Copy link
Member

Choose a reason for hiding this comment

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

Why is this required? I don't see any Git operations afterwards


# Ensure bootstrap script is clean if it exists
[ -f ./bootstrap.sh ] && sed -i 's/\r$//' ./bootstrap.sh || true

# Verify critical project files exist
test -f configure.ac || (echo "configure.ac missing"; exit 1)

# Use custom bootstrap script if available, otherwise use standard autoconf
if [ -x ./bootstrap.sh ]; then
./bootstrap.sh
else
autoreconf -fi
fi
Comment on lines +76 to +80
Copy link
Member

@sjaeckel sjaeckel Oct 14, 2025

Choose a reason for hiding this comment

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

Why should the executable bit change?


- name: Configure
env:
# Ensure pkg-config can find libstrophe we built above
PKG_CONFIG_PATH: ${{ github.workspace }}/deps/libstrophe/install/lib/pkgconfig:$PKG_CONFIG_PATH
run: |
cd "$GITHUB_WORKSPACE"
./configure

- name: Build
run: |
cd "$GITHUB_WORKSPACE"
make -j2

- name: Run tests (collect logs)
continue-on-error: true
run: |
cd "$GITHUB_WORKSPACE"
mkdir -p test-logs
make check > test-logs/make-check.log 2>&1 || true

- name: Upload test logs
uses: actions/upload-artifact@v4
with:
name: cygwin-make-check-logs
path: test-logs/
Loading