Skip to content

Commit aa5b5c7

Browse files
committed
GitHub actions test for Windows native libs
1 parent 8664e6d commit aa5b5c7

File tree

1 file changed

+91
-5
lines changed

1 file changed

+91
-5
lines changed

.github/workflows/windows.yml

+91-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Windows build
33
on: [push, pull_request]
44

55
jobs:
6-
build:
6+
libressl:
77
runs-on: windows-latest
88
defaults:
99
run:
@@ -31,17 +31,103 @@ jobs:
3131
make
3232
make install-strip DESTDIR=/d/a/msmtp/tmp
3333
cp `ldd src/msmtp | awk '/\/ucrt64/ {print $3}' | uniq` /d/a/msmtp/tmp/bin/
34+
- name: Artifacts
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: msmtp-libressl
38+
path: D:\a\msmtp\tmp\
39+
native:
40+
runs-on: windows-latest
41+
defaults:
42+
run:
43+
shell: msys2 {0}
44+
steps:
45+
- name: Check out repository code
46+
uses: actions/checkout@v4
47+
- name: Install build dependencies
48+
uses: msys2/setup-msys2@v2
49+
with:
50+
msystem: UCRT64
51+
update: true
52+
install: >-
53+
mingw-w64-ucrt-x86_64-gcc
54+
pkgconf
55+
automake
56+
autoconf
57+
make
58+
texinfo
59+
- name: Configure
60+
run: |
61+
autoreconf -i
62+
# The only function from libwinpthread is clock_gettime()
63+
./configure --with-tls=sspi --disable-nls LDFLAGS=-Wl,-Bstatic,-lwinpthread
64+
- name: Build
65+
run: |
66+
make
67+
strip --strip-all src/msmtp.exe
68+
- name: List SO imports
69+
run: |
70+
ldd src/msmtp
71+
src/msmtp --version
72+
- name: Test DNS SRV record lookup
73+
continue-on-error: true
74+
run: |
75+
src/msmtp --configure [email protected] | tee output.log
76+
grep -q 'port 587' output.log && echo 🎉 Success
77+
- name: Get server info
78+
continue-on-error: true
79+
run: |
80+
src/msmtp --serverinfo --tls --host=smtp.gmail.com --port=587 | tee output.log
81+
grep -q 'ESMTP' output.log && echo 🎉 Success
82+
- name: Limit to TLSv1.2
83+
continue-on-error: true
84+
run: |
85+
src/msmtp --serverinfo --tls-priorities=PROTOCOLS=TLSv1.2 --tls --host=smtp.gmail.com --port=587 | tee output.log
86+
grep -q 'TLS1\.2' output.log && echo 🎉 Success
87+
- name: Test with wrong host on certificate
88+
continue-on-error: true
89+
run: |
90+
src/msmtp --serverinfo --tls --tls-starttls=off --host=wrong.host.badssl.com --port=443 2>&1 | tee output.log || true
91+
grep -q 'the certificate owner does not match hostname' output.log && echo 🎉 Success
92+
- name: Test with revoked certificate
93+
continue-on-error: true
94+
run: |
95+
src/msmtp --serverinfo --tls --tls-starttls=off --host=revoked.badssl.com --port=443 2>&1 | tee output.log || true
96+
grep -q 'revoked' output.log && echo 🎉 Success
97+
- name: Test with expired certificate
98+
continue-on-error: true
99+
run: |
100+
src/msmtp --serverinfo --tls --tls-starttls=off --host=expired.badssl.com --port=443 2>&1 | tee output.log || true
101+
grep -q 'expired' output.log && echo 🎉 Success
102+
- name: Test with self-signed certificate
103+
continue-on-error: true
104+
run: |
105+
src/msmtp --serverinfo --tls --tls-starttls=off --host=self-signed.badssl.com --port=443 2>&1 | tee output.log || true
106+
grep -q 'not trusted' output.log && echo 🎉 Success
107+
- name: Test with non-secure protocol
108+
continue-on-error: true
109+
run: src/msmtp --serverinfo --tls --tls-starttls=off --host=dh480.badssl.com --port=443
110+
- name: Set locale
111+
shell: pwsh
112+
run: |
113+
Set-WinSystemLocale -SystemLocale ru-RU
114+
- name: Test IDN
115+
continue-on-error: true
116+
run: |
117+
src/msmtp --debug --serverinfo --tls --host=mx3.почта.рус --port=1234 > output.log 2>&1 || true
118+
cat output.log | iconv -f cp1251 -t utf-8
119+
grep -q 'connection refused' output.log && echo 🎉 The host was found successfully but the connection was refused.
34120
- name: Upload release to GitHub
35121
if: github.ref_type == 'tag'
36122
shell: pwsh
37123
env:
38124
GH_TOKEN: ${{ github.token }}
39125
run: |
40-
7z a msmtp.zip D:\a\msmtp\tmp\*
126+
7z a msmtp-native.zip src\msmtp.exe
41127
gh release create ${{ github.ref_name }} --generate-notes || echo "Release already exists!"
42-
gh release upload ${{ github.ref_name }} msmtp.zip
128+
gh release upload ${{ github.ref_name }} msmtp-native.zip#Windows native support for DNS-based configufation, IDN, and Schannel SSP for TLS
43129
- name: Artifacts
44130
uses: actions/upload-artifact@v4
45131
with:
46-
name: msmtp
47-
path: D:\a\msmtp\tmp\
132+
name: msmtp-native
133+
path: src/msmtp.exe

0 commit comments

Comments
 (0)