Skip to content

Commit 659a4cf

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 e8e9c29 commit 659a4cf

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

.github/workflows/cygwin-build.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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+
# Wrapper:
16+
# - convert temp script + workspace to POSIX paths
17+
# - strip CRLF
18+
# - enable igncr and run under Cygwin bash
19+
defaults:
20+
run:
21+
shell: >
22+
C:\tools\cygwin\bin\bash.EXE --login -eo pipefail -c
23+
"p=$(/usr/bin/cygpath -au '{0}');
24+
w=$(/usr/bin/cygpath -au '${{ github.workspace }}');
25+
/usr/bin/sed -i 's/\r$//' \"$p\" || true;
26+
set -o igncr;
27+
cd \"$w\" || (/usr/bin/pwd; /usr/bin/ls -la; exit 2);
28+
/usr/bin/bash -leo pipefail \"$p\""
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Set up Cygwin with build dependencies
37+
uses: egor-tensin/setup-cygwin@v4
38+
with:
39+
packages: >-
40+
autoconf
41+
automake
42+
libtool
43+
make
44+
pkg-config
45+
autoconf-archive
46+
gcc-core
47+
gettext-devel
48+
git
49+
libncursesw-devel
50+
libglib2.0-devel
51+
libcurl-devel
52+
libreadline-devel
53+
libsqlite3-devel
54+
libexpat-devel
55+
libcmocka-devel
56+
57+
- name: Build and install libstrophe from source
58+
run: |
59+
cd "$GITHUB_WORKSPACE"
60+
mkdir -p deps && cd deps
61+
git clone --depth 1 https://github.com/strophe/libstrophe.git
62+
cd libstrophe
63+
autoreconf -i
64+
./configure --prefix=$PWD/install
65+
make -j2 install
66+
67+
- name: Autotools bootstrap
68+
run: |
69+
cd "$GITHUB_WORKSPACE"
70+
71+
# On Windows checkouts the executable bit may be lost and CRLF line endings
72+
# can break shell scripts, so normalize bootstrap.sh if it exists.
73+
if [ -f ./bootstrap.sh ]; then
74+
sed -i 's/\r$//' ./bootstrap.sh
75+
chmod +x ./bootstrap.sh
76+
fi
77+
78+
if [ -x ./bootstrap.sh ]; then
79+
./bootstrap.sh
80+
else
81+
autoreconf -fi
82+
fi
83+
84+
- name: Configure
85+
env:
86+
PKG_CONFIG_PATH: ${{ github.workspace }}/deps/libstrophe/install/lib/pkgconfig:$PKG_CONFIG_PATH
87+
run: |
88+
cd "$GITHUB_WORKSPACE"
89+
./configure
90+
91+
- name: Build
92+
run: |
93+
cd "$GITHUB_WORKSPACE"
94+
make -j2

0 commit comments

Comments
 (0)