mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix CI - MongoDB container action is only supported on Linux
This commit is contained in:
parent
ce48b825e8
commit
a24327455a
1 changed files with 8 additions and 4 deletions
12
.github/workflows/tests.yml
vendored
12
.github/workflows/tests.yml
vendored
|
|
@ -44,8 +44,11 @@ jobs:
|
|||
|
||||
env:
|
||||
# Windows has some limitations:
|
||||
# – Redis is not supported on GitHub Windows runners;
|
||||
# – Redis and MongoDB is not supported on GitHub Windows runners;
|
||||
IS_WINDOWS: ${{ startswith(matrix.os, 'windows') }}
|
||||
# MongoDB has some limitations:
|
||||
# – MongoDB container action is only supported on Linux;
|
||||
IS_UBUNTU: ${{ startswith(matrix.os, 'ubuntu') }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
|
@ -75,7 +78,7 @@ jobs:
|
|||
redis-version: 6
|
||||
|
||||
- name: Setup mongodb
|
||||
if: ${{ env.IS_WINDOWS == 'false' }}
|
||||
if: ${{ env.IS_UBUNTU == 'true' }}
|
||||
uses: supercharge/mongodb-github-action@1.10.0
|
||||
with:
|
||||
mongodb-version: '7.0'
|
||||
|
|
@ -86,7 +89,8 @@ jobs:
|
|||
- name: Run tests
|
||||
run: |
|
||||
flags="$flags --cov=aiogram --cov-config .coveragerc --cov-report=xml"
|
||||
[[ "$IS_WINDOWS" == "false" ]] && flags="$flags --redis redis://localhost:6379/0 --mongo mongodb://mongo:mongo@localhost:27017"
|
||||
[[ "$IS_WINDOWS" == "false" ]] && flags="$flags --redis redis://localhost:6379/0"
|
||||
[[ "$IS_UBUNTU" == "true" ]] && flags="$flags --mongo mongodb://mongo:mongo@localhost:27017"
|
||||
pytest $flags
|
||||
|
||||
- name: Upload coverage data
|
||||
|
|
@ -104,7 +108,7 @@ jobs:
|
|||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
# - macos-latest
|
||||
# - windows-latest
|
||||
python-version:
|
||||
- 'pypy3.8'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue