0
0
Fork 0

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:
Ryu Juheon 2022-12-26 10:40:00 +09:00 committed by GitHub
parent e405a90d0d
commit 1da2cf66a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,17 +57,18 @@ jobs:
ports: ports:
- 127.0.0.1:5432:5432 - 127.0.0.1:5432:5432
mongo: mongo:
image: mongo:5.0 image: mongo
env: env:
MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: test MONGO_INITDB_ROOT_PASSWORD: test
ports: ports:
- 27017:27017 - 27017:27017
options: options:
--health-cmd mongo --health-cmd mongosh
--health-interval 10s --health-interval 10s
--health-timeout 5s --health-timeout 5s
--health-retries 5 --health-retries 5
--name mongo
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.9 - name: Set up Python 3.9
@ -81,10 +82,10 @@ jobs:
pip install -r requirements/test.txt pip install -r requirements/test.txt
- name: Make MongoDB collection - name: Make MongoDB collection
run: | 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 - name: Make collection index
run: | 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 - name: Run tests
run: | run: |
pytest --cov=heliotrope --cov-report=xml --asyncio-mode=auto pytest --cov=heliotrope --cov-report=xml --asyncio-mode=auto