Skip to content

Commit

Permalink
Merge branch 'master' into hotfix-getter
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxins committed Jan 26, 2024
2 parents 75185fa + 91afe1b commit bc9094c
Show file tree
Hide file tree
Showing 31 changed files with 4,242 additions and 761 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/deploy_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,26 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@v3
with:
python-version: '3.x'
cache: true
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install setuptools wheel twine
pip install .
pip install -r requirements/dev.txt
run: pdm install
- name: Test with pytest
run: |
docker-compose -f docker-compose.yaml up -d
docker-compose -f tests/docker-compose.yaml up -d
sleep 20
pytest -s -v -k "not SSL"
working-directory: tests
pdm test
- name: Test SSL connection with pytest
run: |
enable_ssl=true docker-compose -f docker-compose-ssl.yaml up -d
enable_ssl=true docker-compose -f tests/docker-compose-ssl.yaml up -d
sleep 20
pytest -s -v -k "SSL"
working-directory: tests
pdm test-ssl
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_NAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 setup.py sdist bdist_wheel
twine upload dist/*
PDM_PUBLISH_USERNAME: ${{ secrets.PYPI_NAME }}
PDM_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: pdm publish
73 changes: 73 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Generate API reference via Doxygen and push to GitHub Pages
env:
# Specify the doc version to which the API reference belongs
doc_version: 3.6.0
on:
push:
branches:
# Remember to update the branch name when you create a new branch
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all commits/branches for gitversion

- name: Extract branch name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV

- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz
# Generate HTML files
- name: Generate Documentation
run: |
echo "OUTPUT_DIRECTORY=$BRANCH_NAME" >> doxygen-config
doxygen doxygen-config
# Deploy the generated HTML files to the gh-pages branch
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ${{ env.BRANCH_NAME }}/html
target-folder: ${{ env.BRANCH_NAME }}

# - name: show gh-pages branch
# run: |
# git branch
# git checkout .
# git checkout gh-pages

# # Compresses HTML files into a tar.gz file
# - name: compress api reference
# run: |
# tar -zcvf $BRANCH_NAME.tar.gz $BRANCH_NAME

# - name: transfer api reference
# uses: appleboy/scp-action@master
# with:
# host: 20.163.77.63
# username: azureuser
# password: ${{ secrets.ENSITE_PASSWORD }}
# port: 404
# source: $BRANCH_NAME.tar.gz
# # Return error if the target doc version does not already exist
# target: /var/www/ent-docs/${{ env.doc_version }}/

# - name: uncompress ap reference
# uses: appleboy/ssh-action@master
# with:
# host: 20.163.77.63
# username: azureuser
# password: ${{ secrets.ENSITE_PASSWORD }}
# port: 404
# script: |
# mkdir -p /var/www/ent-docs/${{ env.doc_version}}/api/python/
# tar -zxf /var/www/ent-docs/${{ env.doc_version}}/$BRANCH_NAME.tar.gz -C /var/www/ent-docs/${{ env.doc_version}}/api/python/
81 changes: 59 additions & 22 deletions .github/workflows/run_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,36 @@ on:
- cron: "0 6 * * *"

jobs:
ci:
ci-pip-install:
runs-on: ubuntu-20.04
strategy:
max-parallel: 1
matrix:
python-version: [3.6, 3.7]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python setup.py install
pip install pip-tools pytest
- name: Test with pytest==6.2.5
run: |
docker-compose -f docker-compose.yaml up -d
sleep 20
pytest -s -v -k "not SSL"
working-directory: tests


ci:
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
matrix:
python-version: [3.9, '3.10', 3.11, 3.12]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]

steps:
- name: Maximize runner space
Expand All @@ -27,35 +51,48 @@ jobs:

- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
- name: lint
run: make fmt-check
cache: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r requirements/dev.txt
run: pdm install
- name: lint
run: pdm fmt-check
- name: Test with pytest
run: |
docker-compose -f docker-compose.yaml up -d
docker-compose -f tests/docker-compose.yaml up -d
sleep 20
pytest -s -v -k "not SSL" --cov=../nebula3 --cov-report=xml --cov-append
working-directory: tests
pdm test
- name: Test SSL connection with pytest
run: |
enable_ssl=true docker-compose -f docker-compose-ssl.yaml up -d
enable_ssl=true docker-compose -f tests/docker-compose-ssl.yaml up -d
sleep 20
pytest -s -v -k "SSL" --cov=../nebula3 --cov-report=xml --cov-append
working-directory: tests
- name: Test example
run: |
docker-compose -f ../tests/docker-compose.yaml up -d
sleep 20
for f in *.py; do python "$f"; done
working-directory: example
pdm test-ssl
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./tests/coverage.xml
files: coverage.xml

example:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.12]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
cache: true
- name: Install dependencies
run: pdm install -G example
- name: Setup containers
run: |
docker-compose -f tests/docker-compose.yaml up -d
sleep 20
- name: Test example
run: |
for f in example/*.py; do pdm run python "$f"; done
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ nebula/graph.thrift
# CI data
tests/data
tests/logs
.pdm-python
25 changes: 0 additions & 25 deletions Makefile

This file was deleted.

0 comments on commit bc9094c

Please sign in to comment.