From 72f7cd65eb93850463d5c477e72e600b46573fa6 Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Sat, 21 Mar 2020 11:04:12 -0500 Subject: [PATCH] Install openssl on Windows in GH Actions --- .github/workflows/ci.yaml | 27 +++++++++++++++++++++++---- scripts/install-openssl.ps1 | 8 ++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 scripts/install-openssl.ps1 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 846a0ca2a..656dc6ee0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,6 +5,9 @@ on: name: CI +env: + VCPKGRS_DYNAMIC: 1 + jobs: rust_tests: name: Run rust tests @@ -15,8 +18,16 @@ jobs: fail-fast: false steps: - uses: actions/checkout@master - - name: Convert symlinks to hardlink (windows only) - run: powershell.exe scripts/symlinks-to-hardlinks.ps1 + - name: Cache Windows + uses: actions/cache@v1 + with: + key: vcpkg + path: 'C:/vcpkg' + if: runner.os == 'Windows' + - name: Set up the Windows environment + run: | + powershell.exe scripts/symlinks-to-hardlinks.ps1 + powershell.exe scripts/install-openssl.ps1 if: runner.os == 'Windows' - name: Cache cargo dependencies uses: actions/cache@v1 @@ -40,8 +51,16 @@ jobs: fail-fast: false steps: - uses: actions/checkout@master - - name: Convert symlinks to hardlink (windows only) - run: powershell.exe scripts/symlinks-to-hardlinks.ps1 + - name: Cache Windows + uses: actions/cache@v1 + with: + key: vcpkg + path: 'C:/vcpkg' + if: runner.os == 'Windows' + - name: Set up the Windows environment + run: | + powershell.exe scripts/symlinks-to-hardlinks.ps1 + powershell.exe scripts/install-openssl.ps1 if: runner.os == 'Windows' - name: Cache cargo dependencies uses: actions/cache@v1 diff --git a/scripts/install-openssl.ps1 b/scripts/install-openssl.ps1 new file mode 100644 index 000000000..beab80edb --- /dev/null +++ b/scripts/install-openssl.ps1 @@ -0,0 +1,8 @@ +# From the Actix Web windows workflow: +# https://github.com/actix/actix-web/blob/master/.github/workflows/windows.yml +vcpkg integrate install +vcpkg install openssl:x64-windows +Copy-Item C:\vcpkg\installed\x64-windows\bin\libcrypto-1_1-x64.dll C:\vcpkg\installed\x64-windows\bin\libcrypto.dll +Copy-Item C:\vcpkg\installed\x64-windows\bin\libssl-1_1-x64.dll C:\vcpkg\installed\x64-windows\bin\libssl.dll +Get-ChildItem C:\vcpkg\installed\x64-windows\bin +Get-ChildItem C:\vcpkg\installed\x64-windows\lib