Base version - Finalize #352
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Run Tests | |
strategy: | |
matrix: | |
platform: [ ubuntu-latest ] | |
python-version: [ '3.10', '3.11', '3.12' ] | |
mongodb-version: [ '5.0', '6.0' ] | |
runs-on: ${{ matrix.platform }} | |
timeout-minutes: 20 | |
env: | |
DB_SERVER: ${{ secrets.DB_SERVER }} | |
DB_PORT: ${{ secrets.DB_PORT }} | |
DB_USER: ${{ secrets.DB_USER }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
DB_NAME: ${{ secrets.DB_NAME }} | |
PAT: ${{ secrets.PAT }} | |
steps: | |
- name: Set up MongoDB CLI | |
uses: supercharge/mongodb-github-action@1.10.0 | |
with: | |
mongodb-username: ${{ env.DB_USER }} | |
mongodb-password: ${{ env.DB_PASSWORD }} | |
mongodb-db: ${{ env.DB_NAME }} | |
mongodb-port: ${{ env.DB_PORT }} | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set Up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.3 python3 - && \ | |
POETRY_HOME=/opt/poetry python && \ | |
cd /usr/local/bin && \ | |
ln -s /opt/poetry/bin/poetry && \ | |
poetry config virtualenvs.create false | |
- name: Install dependencies | |
run: | | |
cd backend/ | |
poetry install --no-root | |
- name: Lint with ruff | |
run: | | |
cd backend/ | |
ruff check . | |
- name: Run tests | |
run: | | |
cd backend/ | |
python -m pytest |