Skip to content

Commit

Permalink
ci: upgrade tests matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ntarocco committed Mar 5, 2024
1 parent 8eaf059 commit dcc9668
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 31 deletions.
47 changes: 18 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,56 +19,45 @@ jobs:
Tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
# You can add/remove combinations e.g. `dev` requirements or `postgresql13` by adding
# a new item to the following lists.
# You can see the complete list of services and versions that are available at:
# https://docker-services-cli.readthedocs.io/en/latest/configuration.html
python-version: ["3.8", "3.9"]
requirements-level: [pypi]
search-service: [opensearch2, opensearch1]
include:
- search-service: opensearch2
SEARCH_EXTRAS: "opensearch2"

- search-service: opensearch1
SEARCH_EXTRAS: "opensearch1"
# You can add/remove combinations e.g. `dev` requirements or `postgresql13` by adding
# a new item to the following lists.
# You can see the complete list of services and versions that are available at:
# https://docker-services-cli.readthedocs.io/en/latest/configuration.html
python-version: ['3.9', '3.10', '3.11', '3.12']
search-service: [opensearch2, opensearch1]
include:
- search-service: opensearch2
SEARCH_EXTRAS: "opensearch2"

- search-service: opensearch1
SEARCH_EXTRAS: "opensearch1"

env:
SEARCH: ${{ matrix.search-service }}
EXTRAS: tests,${{ matrix.SEARCH_EXTRAS }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Generate dependencies
run: |
pip install wheel requirements-builder
requirements-builder -e "$EXTRAS" --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}
cache: pip
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt
pip install ".[$EXTRAS]"
pip freeze
docker --version
docker-compose --version
- name: Run tests
run: |
./run-tests.sh
run: ./run-tests.sh
4 changes: 3 additions & 1 deletion invenio_stats/aggregations.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ def agg_iter(self, dt, previous_bookmark):
# Skip events that have been previously aggregated.
# The`updated_timestamp` field was introduced with v4.0.0, and it will
# not exist in events created earlier
last_update_aggr = aggregation["last_update"].get("value_as_string", None)
last_update_aggr = aggregation["last_update"].get(
"value_as_string", None
)
if last_update_aggr and previous_bookmark:
last_date = datetime.fromisoformat(last_update_aggr.rstrip("Z"))
if last_date < previous_bookmark:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[metadata]
name = invenio-stats
version = attr: invenio_stats.__version__
description = "Invenio module for collecting statistics."
description = Invenio module for collecting statistics.
long_description = file: README.rst, CHANGES.rst
keywords = invenio statistics
license = MIT
Expand Down

0 comments on commit dcc9668

Please sign in to comment.