-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (63 loc) · 2.31 KB
/
python-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Python CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
neo4j-version: [ "4.4", "5" ]
spark-version:
- {short: "3", ext: "3.1.3", scala: "2.12"}
- {short: "3", ext: "3.2.4", scala: "2.12"}
- {short: "3", ext: "3.2.4", scala: "2.13"}
- {short: "3", ext: "3.3.2", scala: "2.12"}
- {short: "3", ext: "3.3.2", scala: "2.13"}
- {short: "3", ext: "3.4.1", scala: "2.12"}
- {short: "3", ext: "3.4.1", scala: "2.13"}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: avides/[email protected]
id: version
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: pom.xml
only-return-version: true
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pypandoc six tzlocal==2.1
pip install pyspark==${{ matrix.spark-version.ext }} "testcontainers[neo4j]"
- name: Build artifact
env:
CI: true
run: |
mvn clean package -Pspark-${{ matrix.spark-version.short }} -Pscala-${{ matrix.spark-version.scala }} -DskipTests --no-transfer-progress
- name: Run tests for Spark ${{ matrix.spark-version.ext }} and Neo4j ${{ matrix.neo4j-version }}
if: ${{ !(matrix.spark-version.short == 2.4 && matrix.python-version == 3.8) && !(matrix.spark-version.ext == '3.2.0' && matrix.python-version == 3.5) }}
run: |
cd ./python
export PYTHONPATH=$(pwd)
python3 ./test/_util_test.py
python3 ./test/connector_test.py "${{ steps.version.outputs.version }}" "${{ matrix.neo4j-version }}"