Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add alternative test configuration for GitHub Actions #108

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Please see the documentation for all Dependabot configuration options:
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
86 changes: 86 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: "Tests: PR"

on:
push:
branches:
- main
- develop
- ci-gha
Comment on lines +5 to +8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branch names will need to be adjusted as we go. ci-gha was only added to run this branch on the CI of the fork.

pull_request: ~
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: "
Python: ${{ matrix.python-version }}
SQLAlchemy: ${{ matrix.sqla-version }}
"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
sqla-version: ['1.*']
pip-allow-prerelease: ['false']

env:
PYTHON_VERSION: ${{ matrix.python-version }}
SQLALCHEMY_VERSION: ${{ matrix.sqla-version }}
PIP_ALLOW_PRERELEASE: ${{ matrix.pip-allow-prerelease }}

steps:

- name: Acquire sources
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: |
setup.cfg
setup.py
test-requirements.txt

- name: Set up project
run: |

# `setuptools 0.64.0` adds support for editable install hooks (PEP 660).
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
pip install "setuptools>=64" --upgrade

# Install package in editable mode.
pip install --use-pep517 --prefer-binary --editable='.[develop,test]'

# Install development/test dependencies.
pip install -r test-requirements.txt

# Explicitly install designated SQLAlchemy version to validate this test matrix slot.
pip install "sqlalchemy==${{ matrix.sqla-version }}"

- name: Invoke tests
run: |

# Report about the test matrix slot.
echo "Invoking tests with Python ${PYTHON_VERSION} and SQLAlchemy ${SQLALCHEMY_VERSION}"

# Run linters and software tests.
flake8 rdflib_sqlalchemy test
pytest

# https://github.com/codecov/codecov-action
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: main
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ rdflib_sqlalchemy.egg-info
/.eggs/
/dist/
/venv/
.venv*
.coverage
coverage.xml
docs/api

# JetBrains IDE files
/.idea/

test/tmpdb.sqlite
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
RDFLib-SQLAlchemy
=================

[![Tests](https://github.com/RDFLib/rdflib-sqlalchemy/actions/workflows/tests.yml/badge.svg)](https://github.com/RDFLib/rdflib-sqlalchemy/actions/workflows/tests.yml)

A SQLAlchemy-backed, formula-aware RDFLib Store. It stores its triples
in the following partitions:

Expand Down
5 changes: 4 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
norecursedirs = .git env

# Output in color, run doctests
addopts = --color=yes
addopts =
-rsfEX -p pytester --strict-markers --verbosity=3
--cov=rdflib_sqlalchemy --cov-report=term-missing --cov-report=xml
--color=yes

testpaths = test
# Run tests from files matching this glob
Expand Down
2 changes: 2 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
flake8
mock==3.0.5 ; python_version=="2.7"
pytest<8
pytest-cov<5
tox
Loading