Skip to content

Commit

Permalink
add tests-suite workflow (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
VascoSch92 authored Dec 28, 2023
2 parents d0dc932 + 42474de commit 49e50b5
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/tests-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: tests-suite

on:
push:
branches:
- main
- staging
pull_request:
branches:
- main
- staging

jobs:
tests-suite-by-version:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Run tests
run: |
pytest tests
tests-suite:
runs-on: ubuntu-latest
needs: tests-suite-by-version
if: success() || failure()
steps:
- name: Check status of tests-suite-by-version
run: |
if [ "${{ needs.tests-suite-by-version.result }}" != "success" ]; then
echo "Previous job(s) failed."
exit 1
else
echo "All previous jobs passed."
fi
4 changes: 2 additions & 2 deletions tests/tests_meta/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_sequence_class_names_from_md() -> Set:

def extract_integer_sequences_class_names_from_md(content: str) -> Set[str]:
# extract the table integer sequences from the md
integer_sequences_pattern = re.compile(r'## Integer sequences\n(.+?)\n## Generalised sequences', re.DOTALL)
integer_sequences_pattern = re.compile(r'## Integer sequences\n(.+?)\n## Generalised integer sequences', re.DOTALL)
match = re.search(integer_sequences_pattern, content)
generalised_sequences_table = match.group(1).strip()

Expand All @@ -48,7 +48,7 @@ def extract_integer_sequences_class_names_from_md(content: str) -> Set[str]:

def extract_generalised_sequences_class_names_from_md(content: str) -> Set[str]:
# extract the table generalised sequences from the md
generalised_sequences_pattern = re.compile(r'## Generalised sequences\n(.+?)(?=\n##|$)', re.DOTALL)
generalised_sequences_pattern = re.compile(r'## Generalised integer sequences\n(.+?)(?=\n##|$)', re.DOTALL)
match = re.search(generalised_sequences_pattern, content)
generalised_sequences_table = match.group(1).strip()

Expand Down

0 comments on commit 49e50b5

Please sign in to comment.