Skip to content

Commit 7d41e9e

Browse files
authored
Merge pull request #2 from conker84/issue_1
fixes #1: Create Python APIs
2 parents c59a71d + 600e73a commit 7d41e9e

25 files changed

+916
-27
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,31 @@ on:
1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
scala-version: [2.11, 2.12, 2.12]
18+
spark-version: ["2.4", "3"]
19+
neo4j-version: ["3.5", "4.0", "4.1", "4.2", "4.3", "4.4"]
20+
name: Build with Scala ${{ matrix.scala-version }}, Spark ${{ matrix.spark-version }} and Neo4j ${{ matrix.neo4j-version }}
1421
steps:
1522
- uses: actions/checkout@v2
23+
if: ${{ !(matrix.spark-version == 3 && matrix.scala-version == 2.11) && !(matrix.spark-version == 2.4 && matrix.scala-version == 2.13) }}
1624
- name: Set up JDK 8
25+
if: ${{ !(matrix.spark-version == 3 && matrix.scala-version == 2.11) && !(matrix.spark-version == 2.4 && matrix.scala-version == 2.13) }}
1726
uses: actions/setup-java@v1
1827
with:
1928
java-version: 1.8
2029
- name: Cache Maven packages
30+
if: ${{ !(matrix.spark-version == 3 && matrix.scala-version == 2.11) && !(matrix.spark-version == 2.4 && matrix.scala-version == 2.13) }}
2131
uses: actions/cache@v1
2232
with:
2333
path: ~/.m2
2434
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
2535
restore-keys: ${{ runner.os }}-m2
2636
- name: Build with Maven
27-
run: mvn clean verify
37+
if: ${{ !(matrix.spark-version == 3 && matrix.scala-version == 2.11) && !(matrix.spark-version == 2.4 && matrix.scala-version == 2.13) }}
38+
env:
39+
CI: true
40+
MY_ENV: "MY_ENV_value"
41+
run: mvn clean verify -Pscala-${{ matrix.scala-version }} -Pspark-${{ matrix.spark-version }} -Pneo4j-${{ matrix.neo4j-version }} --no-transfer-progress

.github/workflows/python-ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- 'main'
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: [ "3.6", "3.7", "3.8" ]
17+
neo4j-version: [ "3.5", "4.0", "4.1", "4.2", "4.3", "4.4" ]
18+
spark-version: [ {short: "3", ext: "3.0.1", scala: "2.12"}, {short: "3", ext: "3.1.1", scala: "2.12"}, {short: "3", ext: "3.2.0", scala: "2.12"} ]
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Set up JDK 8
26+
uses: actions/setup-java@v1
27+
with:
28+
java-version: 1.8
29+
- uses: avides/[email protected]
30+
id: version
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
file-to-check: pom.xml
34+
only-return-version: true
35+
- name: Cache Maven packages
36+
uses: actions/cache@v1
37+
with:
38+
path: ~/.m2
39+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
40+
restore-keys: ${{ runner.os }}-m2
41+
- name: Install dependencies
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install pypandoc six tzlocal==2.1
45+
pip install pyspark==${{ matrix.spark-version.ext }} "testcontainers[neo4j]"
46+
- name: Build artifact
47+
env:
48+
CI: true
49+
run: |
50+
mvn clean package -Pspark-${{ matrix.spark-version.short }} -Pscala-${{ matrix.spark-version.scala }} -DskipTests --no-transfer-progress
51+
- name: Run tests for Spark ${{ matrix.spark-version.ext }} and Neo4j ${{ matrix.neo4j-version }}
52+
if: ${{ !(matrix.spark-version.short == 2.4 && matrix.python-version == 3.8) && !(matrix.spark-version.ext == '3.2.0' && matrix.python-version == 3.5) }}
53+
run: |
54+
cd ./python
55+
export PYTHONPATH=$(pwd)
56+
python3 ./test/_util_test.py
57+
python3 ./test/connector_test.py "${{ steps.version.outputs.version }}" "${{ matrix.neo4j-version }}"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ docs/guides
3232
doc/node
3333
doc/node_modules
3434
doc/package-lock.json
35-
scripts/python/local
35+
scripts/python/local
36+
python/neo4j_dwh_connector/__pycache__/
37+
python/neo4j_dwh_connector/.pytest_cache/

0 commit comments

Comments
 (0)