-
-
Notifications
You must be signed in to change notification settings - Fork 223
ci: add Cygwin build workflow #2066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ritesh006
wants to merge
1
commit into
profanity-im:master
Choose a base branch
from
ritesh006:ci/cygwin-build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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\"" | ||
|
|
||
| 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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/ | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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