Skip to content

Commit 2b39c84

Browse files
committed
ci: add Cygwin build workflow
Add a GitHub Actions workflow to build with Cygwin on Windows. Fixes issues by forcing Cygwin bash for all steps, handling temporary script paths, stripping CRLF line endings, and enabling igncr.
1 parent 58d130a commit 2b39c84

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

.github/workflows/cygwin-build.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Cygwin
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
cygwin-build:
11+
runs-on: windows-latest
12+
env:
13+
CYGWIN: winsymlinks:nativestrict
14+
15+
defaults:
16+
run:
17+
# Cygwin-specific shell wrapper to handle path conversions and line endings
18+
shell: >
19+
C:\tools\cygwin\bin\bash.EXE --login -eo pipefail -c
20+
"p=$(/usr/bin/cygpath -au '{0}');
21+
w=$(/usr/bin/cygpath -au '${{ github.workspace }}');
22+
/usr/bin/sed -i 's/\r$//' \"$p\" || true;
23+
set -o igncr;
24+
cd \"$w\" || (/usr/bin/pwd; /usr/bin/ls -la; exit 2);
25+
/usr/bin/bash -leo pipefail \"$p\""
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Set up Cygwin with build dependencies
34+
uses: egor-tensin/setup-cygwin@v4
35+
with:
36+
packages: >-
37+
autoconf
38+
automake
39+
libtool
40+
make
41+
pkg-config
42+
autoconf-archive
43+
gcc-core
44+
gettext-devel
45+
git
46+
libncursesw-devel
47+
libglib2.0-devel
48+
libcurl-devel
49+
libreadline-devel
50+
libsqlite3-devel
51+
libexpat-devel
52+
53+
- name: Build and install libstrophe from source
54+
run: |
55+
cd "$GITHUB_WORKSPACE"
56+
mkdir -p deps && cd deps
57+
git clone --depth 1 https://github.com/strophe/libstrophe.git
58+
cd libstrophe
59+
autoreconf -i
60+
./configure --prefix=$PWD/install
61+
make -j2 install
62+
63+
- name: Verify project configuration
64+
run: |
65+
cd "$GITHUB_WORKSPACE"
66+
# Prevent automatic line ending conversions in Cygwin environment
67+
git config --global core.autocrlf false || true
68+
69+
# Ensure bootstrap script is clean if it exists
70+
[ -f ./bootstrap.sh ] && sed -i 's/\r$//' ./bootstrap.sh || true
71+
72+
# Verify critical project files exist
73+
test -f configure.ac || (echo "configure.ac missing"; exit 1)
74+
75+
# Use custom bootstrap script if available, otherwise use standard autoconf
76+
if [ -x ./bootstrap.sh ]; then
77+
./bootstrap.sh
78+
else
79+
autoreconf -fi
80+
fi
81+
82+
- name: Configure
83+
env:
84+
# Ensure pkg-config can find libstrophe we built above
85+
PKG_CONFIG_PATH: ${{ github.workspace }}/deps/libstrophe/install/lib/pkgconfig:$PKG_CONFIG_PATH
86+
run: |
87+
cd "$GITHUB_WORKSPACE"
88+
./configure
89+
90+
- name: Build
91+
run: |
92+
cd "$GITHUB_WORKSPACE"
93+
make -j2
94+
95+
- name: Run tests (collect logs)
96+
continue-on-error: true
97+
run: |
98+
cd "$GITHUB_WORKSPACE"
99+
mkdir -p test-logs
100+
make check > test-logs/make-check.log 2>&1 || true
101+
102+
- name: Upload test logs
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: cygwin-make-check-logs
106+
path: test-logs/

0 commit comments

Comments
 (0)