Test #256
This file contains hidden or 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: Test | |
| on: | |
| push: | |
| branches: | |
| - "*" | |
| schedule: | |
| - cron: '0 3 * * 1' | |
| jobs: | |
| pytest: | |
| runs-on: ubuntu-latest | |
| env: | |
| USE_LOCAL_DDB: "true" | |
| AWS_DEFAULT_REGION: "us-west-2" | |
| AWS_ACCESS_KEY_ID: "dummy" | |
| AWS_SECRET_ACCESS_KEY: "dummy" | |
| LOCAL_DDB_ENDPOINT_URL: "http://localhost:8000" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y python3-dev | |
| pip install boto3 | |
| pip install tenacity | |
| pip install pyparsing | |
| pip install sqlean.py | |
| - name: black | |
| if: matrix.python-version != '3.9' | |
| run: | | |
| pip install black | |
| black --check pydynamodb | |
| - name: flake8 | |
| run: | | |
| pip install flake8 | |
| flake8 pydynamodb | |
| - name: Download DynamoDB local | |
| run: | | |
| curl -O https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz | |
| tar xzf ./dynamodb_local_latest.tar.gz | |
| nohup java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb & | |
| - name: Install sqlalchemy 1.x | |
| run: | | |
| pip install "sqlalchemy>=1.0.0,<2.0.0" | |
| - name: Run test with pytest for sqlalchemy 1.x | |
| run: | | |
| pip install pytest | |
| pip install pytest-cov | |
| pip install moto[sts] | |
| pytest --cov=pydynamodb --cov-report=xml tests/ | |
| - name: Install sqlalchemy 2.x | |
| run: | | |
| pip uninstall -y sqlalchemy | |
| pip install "sqlalchemy>=2.0.0" | |
| - name: Run test with pytest for sqlalchemy 2.x | |
| run: | | |
| pytest --cov=pydynamodb --cov-report=xml tests/ | |
| - name: Upload test coverage | |
| uses: codecov/codecov-action@v4 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| env_vars: OS,PYTHON | |
| files: ./coverage.xml | |
| flags: unittests | |
| fail_ci_if_error: true | |
| verbose: true | |
| sonarcloud: | |
| name: SonarCloud | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: SonarCloud Scan | |
| uses: SonarSource/sonarqube-scan-action@v6.0.0 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |