Skip to content

Commit

Permalink
Test on Windows (#75)
Browse files Browse the repository at this point in the history
* Test on Windows

* Try installing nasm

* Try setting CMAKE_RUNTIME_OUTPUT_DIRECTORY

* Try with chromedriver

* Try using shell: bash
  • Loading branch information
jonasfj authored Jan 10, 2024
1 parent 6aa9725 commit 26299a3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,36 @@ jobs:
--target=integration_test/webcrypto_test.dart \
-d chrome
- run: flutter pub run test -p vm,chrome # TODO: Enable firefox if it works
windows:
name: webcrypto on Windows Chrome / Firefox
runs-on: windows-latest
steps:
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
- name: Configure Flutter
run: |
flutter config --no-analytics
flutter config --enable-windows-desktop
- run: flutter pub get
- run: flutter pub run webcrypto:setup
- run: flutter test
- run: flutter test --platform chrome
- run: flutter test integration_test/webcrypto_test.dart -d windows
working-directory: ./example
- uses: nanasess/setup-chromedriver@v2
- name: Run integration_test with chromedriver
working-directory: ./example
shell: bash
run: |
../tool/with-chromedriver.sh flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/webcrypto_test.dart \
-d chrome
- run: flutter pub run test -p vm,chrome,firefox
ios:
name: webcrypto on iOS emulator (iPhone)
runs-on: macos-latest
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ if(MSVC)
${MSVC_DISABLED_WARNINGS_LIST})
set(CMAKE_C_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}")
set(CMAKE_CXX_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}")

# Hack because Windows compilers will put .dll files in
# $CMAKE_BINARY_DIR/Debug/ folder.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>)
endif()
if(WIN32)
# Windows/MSVC option from CMakeLists.txt in BoringSSL
Expand Down
6 changes: 6 additions & 0 deletions tool/with-chromedriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ else
PLATFORM='linux64'
elif [[ "$OSTYPE" == "darwin"* ]]; then
PLATFORM='mac64'
elif [[ "$OSTYPE" == "cygwin" ]]; then
PLATFORM='win32'
elif [[ "$OSTYPE" == "msys" ]]; then
PLATFORM='win32'
elif [[ "$OSTYPE" == "win32" ]]; then
PLATFORM='win32'
else
echo "Unsupported OSTYPE: $OSTYPE"
exit 1
Expand Down

0 comments on commit 26299a3

Please sign in to comment.