From 73aeae7c112371d7f9059cf20f67e35924b8211f Mon Sep 17 00:00:00 2001 From: James Morris Date: Thu, 10 Dec 2020 16:45:21 -0500 Subject: [PATCH] Try a macOS test on github --- .github/workflows/tests.yml | 7 ++++--- install_dependencies.osx.sh | 22 ++-------------------- tox.sh | 6 +++--- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0af24a5..2af6879 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,9 +2,10 @@ name: run-tox on: [push, pull_request] jobs: unit-tests: - runs-on: ubuntu-16.04 + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-16.04, macos-10.15] python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: @@ -16,10 +17,10 @@ jobs: - name: Install requirements run: | sed -i -e 's/^/#/' tests/gnupghome/gpg-agent.conf - ./install_dependencies.linux.sh + [ $(uname) = "Darwin"] && ./install_dependencies.osx.sh || ./install_dependencies.linux.sh pip install tox - name: Run Tox - run: tox -e py + run: ./tox.sh -e py test-setup: runs-on: ubuntu-16.04 diff --git a/install_dependencies.osx.sh b/install_dependencies.osx.sh index 9db1e47..493813c 100755 --- a/install_dependencies.osx.sh +++ b/install_dependencies.osx.sh @@ -1,22 +1,4 @@ #!/bin/bash -# mapping to get from the TRAVIS_PYTHON_VERSION environment variable to something pyenv understands -# this will need to be manually kept up to date until travis support for python on osx improves -declare -A pyver -pyver["2.7"]="2.7.13" -pyver["3.4"]="3.4.6" -pyver["3.5"]="3.5.3" -pyver["3.6"]="3.6.0" -pyver["3.7"]="3.7.0" -pyver["pypy"]="pypy2-5.6.0" -pyver["pypy3"]="pypy3.3-5.5-alpha" -sudo brew update -# travis doesn't natively support python on osx yet, so start by installing pyenv -# also install newer openssl here -sudo brew install -y pyenv openssl -# now install the requested version of python, and set it to local -pyenv install ${pyver[${TRAVIS_PYTHON_VERSION}]} -pyenv local ${pyver[${TRAVIS_PYTHON_VERSION}]} - -# make sure libffi-dev, gnupg2, pgpdump, and newer openssl are installed as well -sudo brew install -y libffi-dev gnupg2 pgpdump +brew update +brew install -y libffi-dev gnupg2 pgpdump openssl@1.1 diff --git a/tox.sh b/tox.sh index acb2478..f101e2a 100755 --- a/tox.sh +++ b/tox.sh @@ -1,10 +1,10 @@ #!/bin/bash # homebrew is installed and so is a brewed openssl -if [[ $(uname) == "Darwin" ]] && command -v brew &>/dev/null && brew list openssl &>/dev/null; then +if [[ $(uname) == "Darwin" ]] && command -v brew &>/dev/null && brew list openssl@1.1 &>/dev/null; then export ARCHFLAGS="-arch x86_64" - export LDFLAGS="-L/usr/local/opt/openssl/lib" - export CFLAGS="-I/usr/local/opt/openssl/include" + export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" + export CFLAGS="-I/usr/local/opt/openssl@1.1/include" fi exec tox $*