Skip to content

Commit 0a47fd4

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 6ce6942 commit 0a47fd4

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.github/workflows/cygwin-build.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Cygwin build
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+
defaults:
15+
run:
16+
shell: C:\tools\cygwin\bin\bash.exe --login -eo pipefail -o igncr '{0}'
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Cygwin with build dependencies
25+
uses: egor-tensin/setup-cygwin@v4
26+
with:
27+
packages: >-
28+
autoconf
29+
automake
30+
libtool
31+
make
32+
pkg-config
33+
autoconf-archive
34+
gcc-core
35+
gettext-devel
36+
git
37+
libncursesw-devel
38+
libglib2.0-devel
39+
libcurl-devel
40+
libreadline-devel
41+
libsqlite3-devel
42+
libexpat-devel
43+
# or libxml2-devel (optional)
44+
45+
46+
- name: Build and install libstrophe from source
47+
run: |
48+
cd "$GITHUB_WORKSPACE"
49+
mkdir -p deps && cd deps
50+
git clone --depth 1 https://github.com/strophe/libstrophe.git
51+
cd libstrophe
52+
autoreconf -i
53+
./configure --prefix=$PWD/install
54+
make -j2 install
55+
shell: C:\tools\cygwin\bin\bash.exe --login -eo pipefail -o igncr '{0}'
56+
57+
- name: Check repo state
58+
run: |
59+
cd "$GITHUB_WORKSPACE"
60+
pwd
61+
ls -la
62+
test -f configure.ac && echo "configure.ac present" || (echo "configure.ac missing"; exit 1)
63+
64+
- name: Autotools bootstrap
65+
run: |
66+
cd "$GITHUB_WORKSPACE"
67+
git config --global core.autocrlf false || true
68+
[ -f ./bootstrap.sh ] && sed -i 's/\r$//' ./bootstrap.sh || true
69+
if [ -x ./bootstrap.sh ]; then
70+
./bootstrap.sh
71+
else
72+
autoreconf -fi
73+
fi
74+
75+
- name: Configure
76+
env:
77+
PKG_CONFIG_PATH: ${{ github.workspace }}/deps/libstrophe/install/lib/pkgconfig:$PKG_CONFIG_PATH
78+
run: |
79+
cd "$GITHUB_WORKSPACE"
80+
./configure
81+
82+
- name: Build
83+
run: |
84+
cd "$GITHUB_WORKSPACE"
85+
make -j2
86+
87+
# Uncomment when tests are reliable on Cygwin
88+
# - name: Test
89+
# run: |
90+
# cd "$GITHUB_WORKSPACE"
91+
# make check -j2

0 commit comments

Comments
 (0)