Skip to content

Commit

Permalink
Merge 8fe5934 into a6b2b79
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinRiese committed Mar 9, 2023
2 parents a6b2b79 + 8fe5934 commit eebf593
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 1 deletion.
102 changes: 102 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: commcare-export tests
on:
pull_request:
branches:
- master
env:
PG_USER: postgres
PG_PASSWORD: postgres
MYSQL_USER: user
MYSQL_PASSWORD: pass
jobs:
test:
runs-on: ubuntu-22.04
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
env:
SA_PASSWORD: Password-123
ACCEPT_EULA: 'Y'
ports:
- 1433:1433
postgres:
image: postgres
env:
POSTGRES_PASSWORD: ${{ env.PG_PASSWORD }}
POSTGRES_USER: ${{ env.PG_USER }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
# mysql:
# image: mysql:latest
# env:
# MYSQL_ROOT_PASSWORD: "root"
## MYSQL_DATABASE: ${{ env.MYSQL_DB }}
# MYSQL_USER: ${{ env.MYSQL_USER }}
# MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
# options: >-
# --health-cmd="mysqladmin ping"
# --health-interval=10s
# --health-timeout=5s
# --health-retries=3
# ports:
# - 3306:3306
strategy:
matrix:
# python-version: [3.7, 3.8] # Version 3.6 with arch x64 not found
python-version: [3.8]
steps:
- name: Set up MySQL
run: |
mysql --version
sudo service mysql start
mysql -u root -p root -e "GRANT ALL PRIVILEGES ON *.* TO '${{ env.MYSQL_USER }}'@'%';";
env:
DB_USER: root
DB_PASSWORD: 'root'
DB_HOST: localhost

- uses: actions/checkout@v3
with:
fetch-depth: 50
- run: git fetch --tags origin
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt-get install pandoc
- run: python setup.py sdist
- run: pip install dist/*
- run: pip install pymysql psycopg2 pyodbc
- run: pip install coverage coveralls
#- sudo ACCEPT_EULA=Y apt-get install msodbcsql17
- run: pip install mypy
- run: pip install pytest
- run: pip install -e ".[test]"
# - run: coverage run setup.py test
# - run: pytest -m postgres
# env:
# POSTGRES_URL: postgresql://${{ env.PG_USER }}:${{ env.PG_PASSWORD }}@localhost/
- run: pytest -k test_create_checkpoint_table -m mysql
env:
MYSQL_URL: mysql+pymysql://${{ env.MYSQL_USER }}:@localhost/

# - run: mypy --install-types --non-interactive @mypy_typed_modules.txt
# - run: coveralls


# - name: Install docs requirements
# run: pip install -r requirements/docs-requirements.txt
# - name: Test docs build
# run: bash ./scripts/test-make-docs.sh
# - name: Upload test artifacts
# if: always()
# uses: actions/upload-artifact@v3
# with:
# name: make-docs-artifacts
# path: artifacts
# if-no-files-found: ignore
# retention-days: 7
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def run_tests(self):
'pytz',
'requests',
'simplejson',
'sqlalchemy',
'sqlalchemy~=1.4',
'sqlalchemy-migrate'
],
extras_require={
Expand Down

0 comments on commit eebf593

Please sign in to comment.