Skip to content

Commit 22dfb6a

Browse files
Merge pull request #215 from julek-wolfssl/windows-ci
Rewrite tests to python for windows runtime testing
2 parents 25a6aad + a943b30 commit 22dfb6a

99 files changed

Lines changed: 6251 additions & 4828 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Ensure cert/key files always use LF line endings so that hashes
2+
# remain consistent across platforms.
3+
*.pem eol=lf
4+
*.cnf eol=lf
5+
*.cfg eol=lf
6+
7+
# DER files are binary and must never be transformed.
8+
*.der binary

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['*']
6+
pull_request:
7+
branches: ['*']
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu-latest, macos-latest]
15+
config:
16+
- '--enable-wolfclu'
17+
- '--enable-wolfclu --enable-crl --enable-dsa --enable-pkcs7'
18+
- '--enable-wolfclu --enable-smallstack'
19+
- '--enable-wolfclu --enable-experimental --enable-dilithium'
20+
- '--enable-wolfclu --enable-smallstack --enable-experimental --enable-dilithium'
21+
- '--enable-all'
22+
sanitize: ['', 'CC="cc -fsanitize=address"']
23+
24+
name: ${{ matrix.os }} ${{ matrix.sanitize && 'ASAN' || '' }} (${{ matrix.config }})
25+
runs-on: ${{ matrix.os }}
26+
timeout-minutes: 10
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
path: wolfclu
32+
33+
- uses: actions/checkout@v4
34+
with:
35+
repository: wolfssl/wolfssl
36+
ref: master
37+
path: wolfssl
38+
39+
- name: Install dependencies (Ubuntu)
40+
if: runner.os == 'Linux'
41+
run: |
42+
export DEBIAN_FRONTEND=noninteractive
43+
sudo apt-get update
44+
sudo apt-get install -y openssl
45+
46+
- name: Install dependencies (macOS)
47+
if: runner.os == 'macOS'
48+
run: brew install automake libtool
49+
50+
- name: Build and install wolfSSL
51+
working-directory: ./wolfssl
52+
run: |
53+
./autogen.sh
54+
./configure ${{ matrix.config }} ${{ matrix.sanitize }} --prefix=$GITHUB_WORKSPACE/build-dir
55+
make -j
56+
make install
57+
58+
- name: Build wolfCLU
59+
working-directory: ./wolfclu
60+
run: |
61+
./autogen.sh
62+
./configure ${{ matrix.sanitize }} --with-wolfssl=$GITHUB_WORKSPACE/build-dir
63+
make -j
64+
65+
- name: Run tests
66+
working-directory: ./wolfclu
67+
env:
68+
LD_LIBRARY_PATH: ${{ github.workspace }}/build-dir/lib
69+
DYLD_LIBRARY_PATH: ${{ github.workspace }}/build-dir/lib
70+
run: make check
71+
72+
- name: Display log
73+
if: always()
74+
working-directory: ./wolfclu
75+
run: cat test-suite.log || true

.github/workflows/fsanitize-check.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

.github/workflows/macos-check.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/ubuntu-check.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/windows-check.yml

Lines changed: 44 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,56 @@ name: Windows Build Test
22

33
on:
44
push:
5-
branches: [ '*' ]
5+
branches: ['*']
66
pull_request:
7-
branches: [ '*' ]
8-
9-
env:
10-
# Path to the solution file relative to the root of the project.
11-
WOLFSSL_SOLUTION_FILE_PATH: wolfssl/wolfssl64.sln
12-
SOLUTION_FILE_PATH: wolfclu.sln
13-
USER_SETTINGS_H_NEW: wolfclu/ide/winvs/user_settings.h
14-
USER_SETTINGS_H: wolfssl/IDE/WIN/user_settings.h
15-
INCLUDE_DIR: wolfclu
16-
17-
# Configuration type to build.
18-
# You can convert this to a build matrix if you need coverage of multiple configuration types.
19-
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20-
WOLFSSL_BUILD_CONFIGURATION: Release
21-
WOLFCLU_BUILD_CONFIGURATION: Release
22-
BUILD_PLATFORM: x64
23-
TARGET_PLATFORM: 10
7+
branches: ['*']
248

259
jobs:
2610
build:
2711
runs-on: windows-latest
12+
timeout-minutes: 10
13+
14+
env:
15+
BUILD_PLATFORM: x64
16+
BUILD_CONFIGURATION: Release
2817

2918
steps:
30-
- uses: actions/checkout@v2
31-
with:
32-
repository: wolfssl/wolfssl
33-
path: wolfssl
34-
35-
- uses: actions/checkout@master
36-
with:
37-
path: wolfclu
38-
39-
- name: Add MSBuild to PATH
40-
uses: microsoft/setup-msbuild@v1
19+
- uses: actions/checkout@v4
20+
with:
21+
repository: wolfssl/wolfssl
22+
ref: master
23+
path: wolfssl
24+
25+
- uses: actions/checkout@v4
26+
with:
27+
path: wolfclu
28+
29+
- name: Add MSBuild to PATH
30+
uses: microsoft/setup-msbuild@v2
31+
32+
- name: Replace user_settings.h
33+
run: cp wolfclu/ide/winvs/user_settings.h wolfssl/IDE/WIN/user_settings.h
34+
35+
- name: Detect platform toolset
36+
id: toolset
37+
run: |
38+
$major = (vswhere -latest -property installationVersion).Split('.')[0]
39+
$toolsets = @{ "16" = "v142"; "17" = "v143"; "18" = "v145" }
40+
$ts = $toolsets[$major]
41+
if (-not $ts) {
42+
Write-Error "Unsupported Visual Studio major version '$major'."
43+
exit 1
44+
}
45+
echo "value=$ts" >> $env:GITHUB_OUTPUT
46+
47+
- name: Build wolfSSL
48+
run: msbuild /m /p:PlatformToolset=${{ steps.toolset.outputs.value }} /p:Platform=${{ env.BUILD_PLATFORM }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} wolfssl/wolfssl64.sln
49+
50+
- name: Build wolfCLU
51+
working-directory: wolfclu
52+
run: msbuild /m /p:Platform=${{ env.BUILD_PLATFORM }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} wolfclu.sln
4153

42-
- name: Restore wolfSSL NuGet packages
43-
working-directory: ${{env.GITHUB_WORKSPACE}}
44-
run: nuget restore ${{env.WOLFSSL_SOLUTION_FILE_PATH}}
45-
46-
- name: replace with wolfCLU user_settings.h
47-
working-directory: ${{env.GITHUB_WORKSPACE}}
48-
run: cp ${{env.USER_SETTINGS_H_NEW}} ${{env.USER_SETTINGS_H}}
49-
50-
- name: Build wolfssl
51-
working-directory: ${{env.GITHUB_WORKSPACE}}
52-
# Add additional options to the MSBuild command line here (like platform or verbosity level).
53-
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
54-
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:WindowsTargetPlatformVersion=${{env.TARGET_PLATFORM}} /p:Configuration=${{env.WOLFSSL_BUILD_CONFIGURATION}} ${{env.WOLFSSL_SOLUTION_FILE_PATH}}
54+
- name: Run tests
55+
working-directory: wolfclu
56+
run: python tests/run_tests.py
5557

56-
- name: Restore NuGet packages
57-
working-directory: ${{env.GITHUB_WORKSPACE}}wolfclu
58-
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
59-
60-
- name: Build
61-
working-directory: ${{env.GITHUB_WORKSPACE}}wolfclu
62-
# Add additional options to the MSBuild command line here (like platform or verbosity level).
63-
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
64-
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:WindowsTargetPlatformVersion=${{env.TARGET_PLATFORM}} /p:Configuration=${{env.WOLFCLU_BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ src/stamp-h1
4040
.project
4141
.settings/
4242
AGENTS.md
43+
Win32/
44+
x64/
45+
.vs/
46+
__pycache__/
47+
CLAUDE.md

0 commit comments

Comments
 (0)