This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-fast-pbkdf2.git

commit d916ff11e721145447bb0da10de3bf0f321cd80f
Author: Nelson Vides <[email protected]>
AuthorDate: Mon Nov 20 14:20:41 2023 +0100

    Enable testing in windows
    
    Co-authored-by: Ronny Berndt <[email protected]>
---
 .github/workflows/ci.yml | 18 +++++++++++++++---
 rebar.config             | 10 ++++++----
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9b5264b..5c23cf4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,6 +15,10 @@ jobs:
         os: ['ubuntu-22.04']
         otp: ['26.1', '25.3', '24.3']
         rebar3: ['3.22.1']
+        include:
+          - otp: '26.1'
+            rebar3: '3.22.1'
+            os: 'windows-2022'
     runs-on: ${{matrix.os}}
     steps:
       - uses: actions/checkout@v3
@@ -22,6 +26,17 @@ jobs:
         with:
           otp-version: ${{matrix.otp}}
           rebar3-version: ${{matrix.rebar3}}
+
+      - name: Windows - Enable Developer Command Prompt
+        uses: ilammy/[email protected]
+        if: ${{ matrix.os == 'windows-2022' }}
+      - name: Windows - Install openssl
+        shell: pwsh
+        run: |
+          choco install openssl
+          echo "OPENSSL_INSTALL_DIR=""C:\Program Files\OpenSSL""" >> 
$env:GITHUB_ENV
+        if: ${{ matrix.os == 'windows-2022' }}
+
       - name: Restore _build
         uses: actions/cache@v3
         with:
@@ -32,14 +47,11 @@ jobs:
         with:
           path: ~/.cache/rebar3
           key: 
rebar3-cache-for-os-${{matrix.os}}-otp-${{matrix.otp}}-rebar3-${{matrix.rebar3}}-hash-${{hashFiles('rebar.lock')}}
-
       - run: rebar3 as test get-deps
       - run: rebar3 as test compile
       - run: rebar3 as test ct
-
       - run: rebar3 dialyzer
         if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }}
-
       - name: Run coverage
         if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }}
         run: |
diff --git a/rebar.config b/rebar.config
index 518bd1d..c13fb26 100644
--- a/rebar.config
+++ b/rebar.config
@@ -15,8 +15,10 @@
       {rebar3_codecov, "0.6.0"}]},
       {port_env,
         [
-          {"CFLAGS", "$CFLAGS -std=c99 -O0 -g -Wall -Wextra -fPIC --coverage"},
-          {"LDLIBS", "$LDLIBS -lcrypto --coverage"}
+          {"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
+               "$CFLAGS -std=c99 -O0 -g -Wall -Wextra -fPIC --coverage"},
+          {"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
+               "$LDLIBS -lcrypto --coverage"}
         ]
       }
   ]}
@@ -31,8 +33,8 @@
          "CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC"},
     {"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
          "LDLIBS", "$LDLIBS -lcrypto"},
-    {"win32", "CFLAGS", "$CFLAGS /O2 /DNDEBUG /Wall"},
-    {"win32", "LDLIBS", "$LDLIBS libcrypto.lib"},
+    {"win32", "CFLAGS", "$CFLAGS /I${OPENSSL_INSTALL_DIR}/include /O2 /DNDEBUG 
/Wall"},
+    {"win32", "LDLIBS", "$LDLIBS /LIBPATH:${OPENSSL_INSTALL_DIR}/lib 
libcrypto.lib"},
     {"DRV_LINK_TEMPLATE", "$DRV_LINK_TEMPLATE $LDLIBS"}
   ]
 }.

Reply via email to