2021-07-19 09:17:46 +00:00
|
|
|
name: Dependencies
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# View https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule
|
|
|
|
- cron: '0 12 * * *'
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
if: github.repository == 'rq/rq'
|
|
|
|
name: Python${{ matrix.python-version }}/Redis${{ matrix.redis-version }}/redis-py${{ matrix.redis-py-version }}
|
2022-11-26 03:37:27 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2021-07-19 09:17:46 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-06-29 02:54:44 +00:00
|
|
|
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
2022-07-31 09:55:01 +00:00
|
|
|
redis-version: [3, 4, 5, 6, 7]
|
2021-07-19 09:17:46 +00:00
|
|
|
redis-py-version: [3.5.0]
|
|
|
|
|
|
|
|
steps:
|
2022-05-22 05:53:59 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-07-19 09:17:46 +00:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2024-09-16 03:10:47 +00:00
|
|
|
uses: actions/setup-python@v5.2.0
|
2021-07-19 09:17:46 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Start Redis
|
2023-12-18 13:02:18 +00:00
|
|
|
uses: supercharge/redis-github-action@1.8.0
|
2021-07-19 09:17:46 +00:00
|
|
|
with:
|
|
|
|
redis-version: ${{ matrix.redis-version }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
2023-07-09 10:34:25 +00:00
|
|
|
pip install hatch
|
2021-07-19 09:17:46 +00:00
|
|
|
pip install redis==${{ matrix.redis-py-version }}
|
|
|
|
|
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
2023-07-09 10:34:25 +00:00
|
|
|
RUN_SLOW_TESTS_TOO=1 hatch run test:pytest --durations=5
|
2021-07-19 09:17:46 +00:00
|
|
|
|
|
|
|
dependency-build:
|
|
|
|
name: Check development branches of dependencies
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
if: success()
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-06-29 02:54:44 +00:00
|
|
|
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
2022-07-31 09:55:01 +00:00
|
|
|
redis-version: [3, 4, 5, 6, 7]
|
2021-07-19 09:17:46 +00:00
|
|
|
|
|
|
|
steps:
|
2022-05-22 05:53:59 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-07-19 09:17:46 +00:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2024-09-16 03:10:47 +00:00
|
|
|
uses: actions/setup-python@v5.2.0
|
2021-07-19 09:17:46 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Start Redis
|
2023-12-18 13:02:18 +00:00
|
|
|
uses: supercharge/redis-github-action@1.8.0
|
2021-07-19 09:17:46 +00:00
|
|
|
with:
|
|
|
|
redis-version: ${{ matrix.redis-version }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
2023-07-09 10:34:25 +00:00
|
|
|
pip install hatch
|
2021-07-19 09:17:46 +00:00
|
|
|
|
|
|
|
- name: Test with pytest
|
2023-07-09 10:34:25 +00:00
|
|
|
run: RUN_SLOW_TESTS_TOO=1 hatch run test:pytest --durations=5 > log.txt 2>&1
|
2021-07-19 09:17:46 +00:00
|
|
|
|
2023-12-19 10:31:52 +00:00
|
|
|
- uses: actions/upload-artifact@v4
|
2021-07-19 09:17:46 +00:00
|
|
|
with:
|
|
|
|
name: dependencies-error
|
|
|
|
path: log.txt
|
|
|
|
if: failure()
|
|
|
|
|
|
|
|
issue:
|
|
|
|
name: Create failure issue
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
if: failure()
|
|
|
|
needs: dependency-build
|
|
|
|
|
|
|
|
steps:
|
2023-12-19 10:32:08 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2021-07-19 09:17:46 +00:00
|
|
|
with:
|
|
|
|
name: dependencies-error
|
|
|
|
path: .
|
|
|
|
|
|
|
|
- name: Create failure issue
|
|
|
|
run: |
|
2021-07-28 01:34:37 +00:00
|
|
|
if [[ "$(curl --url https://api.github.com/repos/${{ github.repository }}/issues?creator=github-actions --request GET)" != *"\""* ]]
|
2021-07-19 09:17:46 +00:00
|
|
|
then curl --request POST \
|
|
|
|
--url https://api.github.com/repos/${{ github.repository }}/issues \
|
|
|
|
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
|
|
|
|
--header 'content-type: application/json' \
|
|
|
|
--data "{
|
|
|
|
\"title\": \"RQ maybe may not work with dependencies in the future\",
|
|
|
|
\"body\": \"This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n View log: \n\n \`\`\` \n $(cat log.txt | while read line; do echo -n "$line\n"; done | sed -r 's/"/\\"/g') \n \`\`\`\"
|
|
|
|
}"
|
|
|
|
fi
|