chore(ci): fix github actions (#330)
* chore: use latest mongo Signed-off-by: Ryu Juheon <saidbysolo@gmail.com> * chore(ci): fix mongo cmd * chore(ci): fix health cmd * chore(ci): add name mongo * chore(ci): fix eval string * chore(ci): remove string Signed-off-by: Ryu Juheon <saidbysolo@gmail.com>
This commit is contained in:
parent
e405a90d0d
commit
1da2cf66a5
1 changed files with 5 additions and 4 deletions
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
|
@ -57,17 +57,18 @@ jobs:
|
|||
ports:
|
||||
- 127.0.0.1:5432:5432
|
||||
mongo:
|
||||
image: mongo:5.0
|
||||
image: mongo
|
||||
env:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: test
|
||||
ports:
|
||||
- 27017:27017
|
||||
options:
|
||||
--health-cmd mongo
|
||||
--health-cmd mongosh
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
--name mongo
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.9
|
||||
|
@ -81,10 +82,10 @@ jobs:
|
|||
pip install -r requirements/test.txt
|
||||
- name: Make MongoDB collection
|
||||
run: |
|
||||
mongo -u root -p test --eval "db.getSiblingDB('hitomi').createCollection('info')"
|
||||
sudo docker exec -d mongo mongosh -u root -p test --eval "db.getSiblingDB('hitomi').createCollection('info')"
|
||||
- name: Make collection index
|
||||
run: |
|
||||
mongo -u root -p test --eval "db.getSiblingDB('hitomi').getCollection('info').createIndex({'title':'text'}, {'language_override': 'korean'})"
|
||||
sudo docker exec -d mongo mongosh -u root -p test --eval "db.getSiblingDB('hitomi').getCollection('info').createIndex({'title':'text'}, {'language_override': 'korean'})"
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest --cov=heliotrope --cov-report=xml --asyncio-mode=auto
|
||||
|
|
Reference in a new issue