From 81c23bc4cb518b2892ed1ffd089e610a45013692 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 14 May 2024 14:53:54 -0300 Subject: tests: setup openssl via brew with new paths https://stackoverflow.com/questions/29651258/install-openssl-devel-on-mac --- .github/workflows/test.yml | 4 ++++ spec/util/test_env.lua | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63391324..f9b897f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,6 +39,10 @@ jobs: - uses: leafo/gh-actions-luarocks@v4.0.0 + - name: 'Setup macOS deps' + if: ${{ contains(matrix.os, 'macos') }} + run: brew install openssl + - name: Prep run: | luarocks install busted diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 1d38cec6..92fb1939 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua @@ -391,8 +391,19 @@ function test_env.set_args() elseif system == "Darwin" then test_env.TEST_TARGET_OS = "osx" if test_env.CI then - test_env.OPENSSL_INCDIR = "/usr/local/opt/openssl/include" - test_env.OPENSSL_LIBDIR = "/usr/local/opt/openssl/lib" + if exists("/opt/homebrew/opt/openssl@3/include") then + test_env.OPENSSL_INCDIR = "/opt/homebrew/opt/openssl@3/include" + test_env.OPENSSL_LIBDIR = "/opt/homebrew/opt/openssl@3/lib" + elseif exists("/opt/homebrew/opt/openssl@1.1/include") then + test_env.OPENSSL_INCDIR = "/opt/homebrew/opt/openssl@1.1/include" + test_env.OPENSSL_LIBDIR = "/opt/homebrew/opt/openssl@1.1/lib" + elseif exists("/opt/homebrew/opt/openssl/include") then + test_env.OPENSSL_INCDIR = "/opt/homebrew/opt/openssl/include" + test_env.OPENSSL_LIBDIR = "/opt/homebrew/opt/openssl/lib" + else + test_env.OPENSSL_INCDIR = "/usr/local/opt/openssl/include" + test_env.OPENSSL_LIBDIR = "/usr/local/opt/openssl/lib" + end end end end -- cgit v1.2.3-55-g6feb