ci: github actions CI for Windows x86 and x64 (#1554)

* ci: add windows x86 builds

* ci: run windows tests
This commit is contained in:
Raihaan Shouhell 2023-09-21 02:46:50 +08:00 committed by GitHub
parent e6c650c2ef
commit 007219c347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 1 deletions

View File

@ -0,0 +1,12 @@
# SPDX-License-Identifier: MIT
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR AMD64)
set(CMAKE_CROSSCOMPILING OFF)
set(CMAKE_GENERATOR_PLATFORM
x64
CACHE STRING "Platform" FORCE
)

View File

@ -0,0 +1,12 @@
# SPDX-License-Identifier: MIT
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86)
set(CMAKE_CROSSCOMPILING OFF)
set(CMAKE_GENERATOR_PLATFORM
Win32
CACHE STRING "Platform" FORCE
)

View File

@ -12,3 +12,21 @@ jobs:
run: cmake -B build --toolchain .CMake/toolchain_windows_arm64.cmake .
- name: Build Project
run: cmake --build build
windows-x86:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
toolchain: [.CMake/toolchain_windows_x86.cmake, .CMake/toolchain_windows_amd64.cmake]
steps:
- uses: actions/checkout@v3
- name: Generate Project
run: cmake -B build --toolchain ${{ matrix.toolchain }} .
- name: Build Project
run: cmake --build build
- name: Test dependencies
run: pip.exe install pytest pytest-xdist pyyaml
- name: Run tests
run: |
python -m pytest --numprocesses=auto -vv --maxfail=10 --ignore=tests/test_code_conventions.py --junitxml=build\test-results\pytest\test-results.xml

View File

@ -141,6 +141,9 @@ def path_to_executable(program_name):
if 'APPVEYOR_BUILD_FOLDER' not in os.environ: os.environ['APPVEYOR_BUILD_FOLDER'] = "."
path = os.path.join(path, os.environ['APPVEYOR_BUILD_FOLDER'])
path = os.path.join(path, get_current_build_dir_name(), "tests")
if sys.platform.startswith("win"):
if 'GITHUB_ACTIONS' in os.environ:
path = os.path.join(path, "Debug")
for executable in [
os.path.join(path, program_name),
os.path.join(path, program_name + ".EXE"),

View File

@ -11,11 +11,19 @@
#define MAXPATHLEN 128
#if (defined(_WIN32) || defined(__WIN32__))
#define mkdir(A, B) mkdir(A)
#include <windows.h>
#endif
static OQS_STATUS oqs_fstore_init(void) {
#ifndef _WIN32
return mkdir(OQS_STORE_DIR, 0755);
#else
if (CreateDirectory(OQS_STORE_DIR, NULL)) {
return OQS_SUCCESS;
} else {
return OQS_ERROR;
}
#endif
}
static OQS_STATUS oqs_fstore(const char *fname, const char *mname, uint8_t *data, size_t len) {