Skip to content
Merged
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
26 changes: 26 additions & 0 deletions .github/workflows/biweekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Biweekly

on:
schedule:
- cron: "0 0 1,15 * *" # almost biweekly, twice a month

jobs:
build:
uses: ./.github/workflows/ci.yml
secrets: inherit

notify-failure:
needs:
- build
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Failure
uses: slackapi/slack-github-action@v1
with:
payload: |
{
"failed_workflow": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.RQE_NOTIFY_NIGHTLY_FAIL_HOOK }}
52 changes: 33 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,50 @@ on:
branches:
- master
pull_request:
schedule:
- cron: "0 0 * * *"
workflow_call:

concurrency:
# if the event is a pull request, use the PR number to make PR checks cancel previous runs
# if the event is not a pull request, use the run number to make each run unique
group: CI-${{ github.event_name == 'pull_request' && github.event.number || github.run_number }}
cancel-in-progress: true

jobs:
build:
name: Test on ${{ matrix.platform }} with Python ${{ matrix.python }} with Redis ${{ matrix.redis-version }}
runs-on: ${{ matrix.platform }}
timeout-minutes: 40
strategy:
fail-fast: ${{ github.event_name == 'pull_request' }}
matrix:
platform: ['ubuntu-22.04', 'macos-13']
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
redis-version: ['7.0', '7.2']
fail-fast: false
platform: ['ubuntu-latest', 'macos-latest']
python: ['3.10', '3.14'] # min live version, latest testing
redis-version: ['7.4', '8.2']
# ubuntu-latest no longer supports python 3.7, macos-latest no longer supports python 3.10
include:
- platform: ubuntu-22.04
python: '3.7'
redis-version: '7.4'
poetry-version: '1.5.1'
- platform: macos-latest
python: '3.11'
redis-version: '8.2'
exclude:
- platform: macos-latest
python: '3.10'
defaults:
run:
shell: bash -l -eo pipefail {0}

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
# Number of commits to fetch. 0 indicates all history for all branches and tags.
with:
fetch-depth: ''

- name: clone redis
uses: actions/checkout@v3
uses: actions/checkout@v4
# Number of commits to fetch. 0 indicates all history for all branches and tags.
with:
fetch-depth: ''
Expand All @@ -40,31 +57,28 @@ jobs:
path: redis

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
architecture: x64

- name: Setup Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
version: ${{ matrix.poetry-version || '2.2.1' }}
virtualenvs-in-project: true
virtualenvs-create: true
installer-parallel: true

- name: Cache poetry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/poetry # This path is specific to Ubuntu
path: .venv
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ matrix.platform }}-${{ matrix.python }}-pyproject.toml-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ matrix.platform }}-${{ matrix.python }}-pyproject.toml-${{hashFiles('pyproject.toml')}}}


- name: Install Python dependencies
run: poetry install -q
run: poetry install

- name: Install Redis Server
working-directory: redis
Expand Down Expand Up @@ -189,7 +203,7 @@ jobs:
--tls

- name: Generate coverage report
if: matrix.python == '3.9' && matrix.platform != 'macos-13'
if: matrix.python == '3.14' && matrix.platform == 'ubuntu-latest'
run: |
TLS="tests/flow/tls"
TLS_CERT=$TLS/redis.crt \
Expand All @@ -199,8 +213,8 @@ jobs:
poetry run pytest --ignore=tests/flow --ignore=test_example.py --cov-config=.coveragerc --cov-report=xml --cov=RLTest

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.python == '3.9' && matrix.platform != 'macos-13'
uses: codecov/codecov-action@v4
if: matrix.python == '3.14' && matrix.platform == 'ubuntu-latest'
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
13 changes: 10 additions & 3 deletions RLTest/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
# This attribute is the only one place that the version number is written down,
# so there is only one place to change it when the version number changes.
try:
import pkg_resources
__version__ = pkg_resources.get_distribution('RLTest').version
except (pkg_resources.DistributionNotFound, AttributeError, ImportError):
from importlib.metadata import version
except ImportError:
try: # For Python<3.8
from importlib_metadata import version # type: ignore
except ImportError:
version = None

try:
__version__ = version('RLTest')
except Exception:
__version__ = "99.99.99" # like redis modules
Loading
Loading