File tree Expand file tree Collapse file tree 4 files changed +42
-56
lines changed Expand file tree Collapse file tree 4 files changed +42
-56
lines changed Original file line number Diff line number Diff line change 18
18
os : [ubuntu-latest]
19
19
python-version : ['3.7', '3.8', '3.9', '3.10']
20
20
cratedb-version : ['nightly']
21
- sqla-version : ['1.3.24 ']
21
+ sqla-version : ['1.4.37 ']
22
22
fail-fast : false
23
+ env :
24
+ CRATEDB_VERSION : ${{ matrix.cratedb-version }}
25
+ SQLALCHEMY_VERSION : ${{ matrix.sqla-version }}
23
26
24
27
steps :
25
28
- uses : actions/checkout@v3
@@ -28,13 +31,15 @@ jobs:
28
31
with :
29
32
python-version : ${{ matrix.python-version }}
30
33
31
- - name : Propagate matrix information
32
- run : |
33
- source bootstrap.sh
34
- ./devtools/setup_ci.sh --cratedb-version=${{ matrix.cratedb-version }} --sqlalchemy-version=${{ matrix.sqla-version }}
35
-
36
34
- name : Invoke tests
37
35
run : |
36
+
37
+ # Bootstrap environment.
38
38
source bootstrap.sh
39
+
40
+ # Propagate build matrix information.
41
+ ./devtools/setup_ci.sh
42
+
43
+ # Invoke validation tasks.
39
44
flake8 src bin
40
45
coverage run bin/test -vv1
Original file line number Diff line number Diff line change 21
21
cratedb-version : ['4.8.0']
22
22
sqla-version : ['1.3.24', '1.4.37']
23
23
fail-fast : true
24
+ env :
25
+ CRATEDB_VERSION : ${{ matrix.cratedb-version }}
26
+ SQLALCHEMY_VERSION : ${{ matrix.sqla-version }}
24
27
25
28
steps :
26
29
- uses : actions/checkout@v3
@@ -29,22 +32,20 @@ jobs:
29
32
with :
30
33
python-version : ${{ matrix.python-version }}
31
34
32
- - name : Adjust environment for macOS
33
- if : matrix.os == 'macos-latest'
35
+ - name : Invoke tests
34
36
run : |
35
- brew install gnu-getopt
36
- echo "/usr/local/opt/gnu-getopt/bin" >> $GITHUB_PATH
37
37
38
- - name : Propagate matrix information
39
- run : |
38
+ # Bootstrap environment.
40
39
source bootstrap.sh
41
- ./devtools/setup_ci.sh --cratedb-version=${{ matrix.cratedb-version }} --sqlalchemy-version=${{ matrix.sqla-version }}
42
40
43
- - name : Invoke tests
44
- run : |
45
- source bootstrap.sh
41
+ # Propagate build matrix information.
42
+ ./devtools/setup_ci.sh
43
+
44
+ # Invoke validation tasks.
46
45
flake8 src bin
47
46
coverage run bin/test -vv1
47
+
48
+ # Set the stage for the Codecov step.
48
49
coverage xml
49
50
50
51
# https://github.com/codecov/codecov-action
Original file line number Diff line number Diff line change 16
16
# Trace all invocations.
17
17
# set -x
18
18
19
+ # Default variables.
20
+ BUILDOUT_VERSION=${BUILDOUT_VERSION:- 2.13.7}
21
+ CRATEDB_VERSION=${CRATEDB_VERSION:- 4.8.1}
22
+ SQLALCHEMY_VERSION=${SQLALCHEMY_VERSION:- 1.4.37}
23
+
19
24
20
25
function print_header() {
21
26
printf ' =%.0s' {1..42}; echo
@@ -50,8 +55,8 @@ function before_setup() {
50
55
#
51
56
pip install wheel
52
57
53
- BUILDOUT_VERSION= ${BUILDOUT_VERSION :- 2.13.7}
54
- pip install " zc.buildout==${BUILDOUT_VERSION} "
58
+ # Install Buildout with designated version, allowing pre-releases.
59
+ pip install --pre " zc.buildout==${BUILDOUT_VERSION} "
55
60
56
61
}
57
62
@@ -70,7 +75,10 @@ function finalize() {
70
75
71
76
# Some steps before dropping into the activated virtualenv.
72
77
echo
73
- python -c ' import sqlalchemy; print(f"SQLAlchemy version: {sqlalchemy.__version__}")'
78
+ echo " Sandbox environment ready"
79
+ echo -n " Using SQLAlchemy version: "
80
+ python -c ' import sqlalchemy; print(sqlalchemy.__version__)'
81
+ echo
74
82
75
83
}
76
84
@@ -84,7 +92,7 @@ function main() {
84
92
}
85
93
86
94
function lint() {
87
- flake8
95
+ flake8 " $@ " src bin
88
96
}
89
97
90
98
main
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
- function args() {
6
- options=$( getopt --long cratedb-version: --long sqlalchemy-version: -- " $@ " )
7
- [ $? -eq 0 ] || {
8
- echo " Incorrect options provided"
9
- exit 1
10
- }
11
- eval set -- " $options "
12
- while true ; do
13
- case " $1 " in
14
- --cratedb-version)
15
- shift ;
16
- cratedb_version=$1
17
- ;;
18
- --sqlalchemy-version)
19
- shift ;
20
- sqlalchemy_version=$1
21
- ;;
22
- --)
23
- shift
24
- break
25
- ;;
26
- esac
27
- shift
28
- done
29
- }
30
-
31
5
function main() {
32
6
33
- # Read command line arguments.
34
- args $0 " $@ "
35
-
36
7
# Sanity checks.
37
- [ -z ${cratedb_version } ] && {
8
+ [ -z ${CRATEDB_VERSION } ] && {
38
9
echo " --cratedb-version must be given"
10
+ echo " Environment variable 'CRATEDB_VERSION' needed"
39
11
exit 1
40
12
}
41
- [ -z ${sqlalchemy_version } ] && {
42
- echo " --sqlalchemy-version must be given "
13
+ [ -z ${SQLALCHEMY_VERSION } ] && {
14
+ echo " Environment variable 'SQLALCHEMY_VERSION' needed "
43
15
exit 1
44
16
}
45
17
46
18
# Let's go.
47
- echo " Invoking tests with CrateDB ${cratedb_version } and SQLAlchemy ${sqlalchemy_version } "
19
+ echo " Invoking tests with CrateDB ${CRATEDB_VERSION } and SQLAlchemy ${SQLALCHEMY_VERSION } "
48
20
49
21
# Install designated SQLAlchemy version.
50
- pip install " sqlalchemy==${sqlalchemy_version } "
22
+ pip install " sqlalchemy==${SQLALCHEMY_VERSION } "
51
23
52
24
# Replace CrateDB version.
53
- if [ ${cratedb_version } = " nightly" ]; then
25
+ if [ ${CRATEDB_VERSION } = " nightly" ]; then
54
26
sed -ir " s/releases/releases\/nightly/g" buildout.cfg
55
27
sed -ir " s/crate_server.*/crate_server = latest/g" versions.cfg
56
28
else
57
- sed -ir " s/crate_server.*/crate_server = ${cratedb_version } /g" versions.cfg
29
+ sed -ir " s/crate_server.*/crate_server = ${CRATEDB_VERSION } /g" versions.cfg
58
30
fi
59
31
60
32
}
You can’t perform that action at this time.
0 commit comments