Skip to content

PyTest

PyTest #354

Workflow file for this run

# -*- coding: utf-8 -*- --------------------------------------------------===#
#
# Copyright 2022-2026 Trovares Inc. dba Rocketgraph.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#===----------------------------------------------------------------------===#
name: PyTest
on:
push:
branches: [ main ]
paths:
- '.github/**'
- 'src/**'
- 'test/**'
pull_request:
branches: [ main ]
paths:
- '.github/**'
- 'src/**'
- 'test/**'
schedule:
# Monday at 5 AM UTC.
- cron: "0 5 * * 1"
workflow_dispatch:
jobs:
test:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install parameterized pyodbc pandas
pip install pytest
pip install './[odbc]'
sudo apt-get install odbc-mariadb
- name: Setup ODBC Driver
run: |
ls /usr/lib/x86_64-linux-gnu/odbc/
echo -e '[MariaDB]\nDescription = ODBC Driver for MariaDB\nDriver = /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so\nFileUsage = 1' | sudo tee -a /etc/odbcinst.ini > /dev/null
- name: Launch neo4j
run: |
mkdir -p neo4j/plugins
docker run --rm -d --name neo4j -p7474:7474 -p7687:7687 -p 9999:9999 \
--user=$(id -u):$(id -g) -v $PWD/neo4j/plugins:/var/lib/neo4j/plugins \
--env NEO4J_AUTH=neo4j/foo --env NEO4J_EDITION=community \
--env NEO4JLABS_PLUGINS='["graph-data-science"]' \
--env HOST=0.0.0.0 --env NEO4J_dbms_default__listen__address=0.0.0.0 \
neo4j:4.4.12
- name: Launch mariadb
run: |
docker run --rm -d --name mysql -p3306:3306 -e MYSQL_ROOT_PASSWORD=foo \
-e MYSQL_USER=test -e MYSQL_PASSWORD=foo \
-e MYSQL_DATABASE=test -d mariadb:latest
- name: Launch xGT
run: "docker run --rm -d --name xgt -p 4367:4367 rocketgraph/xgt"
- name: Show docker containers
run: "docker ps -a"
- name: Run test suite
run: |
pytest -v -s test