summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorodidev <odidev@puresoftware.com>2020-07-14 15:39:35 +0530
committerodidev <odidev@puresoftware.com>2020-08-25 06:37:53 +0000
commit6de8c0c6d286a78b9f5fbfadb8be5989bf180292 (patch)
treee71670b6be4759969ca0e8e3c11d52aebf8e2997
parentf7618f8bf5a59baddba9fcab4ca9e8e2ba53cb5b (diff)
downloadpsycopg2-6de8c0c6d286a78b9f5fbfadb8be5989bf180292.tar.gz
Add ARM64 jobs in Travis-CI
Signed-off-by: odidev <odidev@puresoftware.com>
-rw-r--r--.travis.yml18
-rwxr-xr-xscripts/travis_prepare.sh26
-rwxr-xr-xscripts/travis_test.sh28
3 files changed, 49 insertions, 23 deletions
diff --git a/.travis.yml b/.travis.yml
index 25c702b..56355c2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,16 +2,24 @@
language: python
+dist: bionic
+
+arch:
+ - amd64
+ - arm64
+
+python:
+ - 3.5
+ - 3.6
+ - 3.7
+ - 3.8
+
matrix:
include:
- python: 2.7
- - python: 3.8
- - python: 3.7
- - python: 3.6
- - python: 3.5
- - python: 3.4
install:
+ - sudo apt-get install -y bc
- pip install -U pip setuptools wheel
- pip install .
- rm -rf psycopg2.egg-info
diff --git a/scripts/travis_prepare.sh b/scripts/travis_prepare.sh
index 1e18593..068285c 100755
--- a/scripts/travis_prepare.sh
+++ b/scripts/travis_prepare.sh
@@ -13,6 +13,11 @@ set -e -x
#
# The variables can be set in the travis configuration
# (https://travis-ci.org/psycopg/psycopg2/settings)
+export TEST_PAST=${TEST_PAST:-0}
+export TEST_FUTURE=${TEST_FUTURE:-0}
+export TEST_VERBOSE=${TEST_VERBOSE:-0}
+export PSYCOPG2_TEST_FAST=${PSYCOPG2_TEST_FAST:-0}
+export TEST_PRESENT=${TEST_PRESENT:-1}
set_param () {
# Set a parameter in a postgresql.conf file
@@ -115,16 +120,19 @@ create () {
# Would give a permission denied error in the travis build dir
cd /
-# Postgres versions supported by Travis CI
-if (( ! "$DONT_TEST_PRESENT" )); then
- create 12
- create 11
- create 10
- create 9.6
- create 9.5
- create 9.4
+if (( "$TEST_PRESENT" )); then
+ if [[ ${TRAVIS_CPU_ARCH} == "arm64" ]]; then
+ # Postgres versions supported by ARM64
+ create 10
+ else
+ create 12
+ create 11
+ create 10
+ create 9.6
+ create 9.5
+ create 9.4
+ fi
fi
-
# Unsupported postgres versions that we still support
# Images built by https://github.com/psycopg/psycopg2-wheels/tree/build-dinosaurs
if (( "$TEST_PAST" )); then
diff --git a/scripts/travis_test.sh b/scripts/travis_test.sh
index a3de9ec..69a6236 100755
--- a/scripts/travis_test.sh
+++ b/scripts/travis_test.sh
@@ -13,6 +13,12 @@
set -e -x
+export TEST_PAST=${TEST_PAST:-0}
+export TEST_FUTURE=${TEST_FUTURE:-0}
+export TEST_VERBOSE=${TEST_VERBOSE:-0}
+export PSYCOPG2_TEST_FAST=${PSYCOPG2_TEST_FAST:-0}
+export TEST_PRESENT=${TEST_PRESENT:-1}
+
run_test () {
VERSION=$1
DBNAME=psycopg2_test
@@ -44,16 +50,20 @@ run_test () {
$VERBOSE
}
-# Postgres versions supported by Travis CI
-if (( ! "$DONT_TEST_PRESENT" )); then
- run_test 12
- run_test 11
- run_test 10
- run_test 9.6
- run_test 9.5
- run_test 9.4
+if (( "$TEST_PRESENT" )); then
+ if [[ "${TRAVIS_CPU_ARCH}" == "arm64" ]]; then
+ # Postgres versions supported by ARM64
+ run_test 10
+ else
+ # Postgres versions supported by Travis CI
+ run_test 12
+ run_test 11
+ run_test 10
+ run_test 9.6
+ run_test 9.5
+ run_test 9.4
+ fi
fi
-
# Unsupported postgres versions that we still support
# Images built by https://github.com/psycopg/psycopg2-wheels/tree/build-dinosaurs
if (( "$TEST_PAST" )); then