Skip to content

hugegraph-py-test CI #80

hugegraph-py-test CI

hugegraph-py-test CI #80

Workflow file for this run

name: "hugegraph-py-test CI"
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 17 */3 * *'
workflow_dispatch:
permissions: write-all
env:
release_version: 1.3.0
CI: github
jobs:
# job: openSource and no auth
disable_auth:
name: disable_auth
runs-on: ubuntu-latest
strategy:
fail-fast: false
# max-parallel: 3
matrix:
python-version: ["3.9", "3.10"]
java-version: ['11'] # java8 dropped > 1.3.0
# TODO: use 'enable_auth' matrix to replace the duplicate CI code
steps:
- name: pull python code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Install Java ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
# TODO: it need check the pom.xml, need refactor the logic
# cache: 'maven'
- name: cache maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
# due to lack pom.xml file, so use requirements.txt to hash first
key: ${{ runner.os }}-maven-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
cache: 'pip'
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt
- name: deploy hugegraph
run: |
python src/deploy_start.py all
- name: decompress dataset.zip
run: |
unzip src/config/dataset.zip -d src/config/
- name: run test cases
run: |
pytest --html=test.html --capture=tee-sys ||
(tail -500 /home/runner/work/hugegraph-test/hugegraph-test/graph/hugegraph-toolchain/*/*/logs/hugegraph-hubble.log && exit 1)
# job: enable auth test
enable_auth:
name: enable_auth
runs-on: ubuntu-latest
strategy:
fail-fast: false
# max-parallel: 3
matrix:
python-version: ["3.9", "3.10"]
java-version: ['11']
steps:
- name: pull python code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Install Java ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
# cache: 'maven'
- name: cache maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
architecture: 'x64'
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt
- name: deploy hugegraph
run: |
sed -i -e "s/^is_auth.*$/is_auth = True/g" src/config/basic_config.py
python src/deploy_start.py all
- name: decompress dataset.zip
run: |
unzip src/config/dataset.zip -d src/config/
- name: run test cases
run: |
pytest --html=test.html --capture=tee-sys
# TODO: clean it after all CI code is refactored
# # job: openSource and no auth with https
# disable_auth_https:
# name: openSource and no auth with https
# runs-on: ubuntu-latest
# strategy:
# max-parallel: 3
# matrix:
# python-version: ["3.10"]
# java-version: ['8', '11']
#
# steps:
# - name: Install Java ${{ matrix.java-version }}
# uses: actions/setup-java@v4
# with:
# java-version: ${{ matrix.java-version }}
# distribution: 'adopt'
#
# - name: cache maven repository
# uses: actions/cache@v3
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-maven-${{ hashFiles('**/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-maven-
#
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# architecture: 'x64'
#
# - name: cache python dependencies
# uses: actions/cache@v3
# id: cache-pip
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-
#
# - name: checkout python scripts
# uses: actions/checkout@v4
# with:
# fetch-depth: 2
#
# - name: install python dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r ./requirements.txt
#
# - name: deploy hugegraph
# run: |
# sed -i -e "s/^is_https.*$/is_https = True/g" src/config/basic_config.py
# python src/deploy_start.py all
#
# - name: decompress dataset.zip
# run: |
# unzip src/config/dataset.zip
# mv dataset src/config/
#
# - name: run test cases
# run: |
# pytest --html=test.html --capture=tee-sys