|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Python package |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [master] |
| 9 | + pull_request: |
| 10 | + branches: [master] |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + python-version: [3.9] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - name: Set up Python ${{ matrix.python-version }} |
| 22 | + uses: actions/setup-python@v2 |
| 23 | + with: |
| 24 | + python-version: ${{ matrix.python-version }} |
| 25 | + - name: Set up DynamoDB Local |
| 26 | + run: | |
| 27 | + mkdir /tmp/dynamodb_local |
| 28 | + wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz | tar xz --directory /tmp/dynamodb_local |
| 29 | + java -Djava.library.path=/tmp/dynamodb_local/DynamoDBLocal_lib -jar /tmp/dynamodb_local/DynamoDBLocal.jar -sharedDb -inMemory & |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + python -m pip install --upgrade pip |
| 33 | + pip install flake8 |
| 34 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 35 | + - name: Lint with flake8 |
| 36 | + run: | |
| 37 | + # stop the build if there are Python syntax errors or undefined names |
| 38 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 39 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 40 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 41 | + - name: Test basic restore and backup |
| 42 | + run: | |
| 43 | + mkdir dump && cp -a test/testTable dump |
| 44 | + python dynamodump.py -m restore -r local -s testTable -d testRestoredTable --host localhost --port 8000 --accessKey a --secretKey a |
| 45 | + python dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 --accessKey a --secretKey a |
| 46 | + python test/test.py |
| 47 | + - name: Test wildcard restore and backup |
| 48 | + run: | |
| 49 | + python dynamodump.py -m restore -r local -s "*" --host localhost --port 8000 --accessKey a --secretKey a |
| 50 | + rm -rf dump/test* |
| 51 | + python dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a --secretKey a |
| 52 | + python test/test.py |
| 53 | + - name: Test prefixed wildcard restore and backup |
| 54 | + run: | |
| 55 | + python dynamodump.py -m restore -r local -s "test*" --host localhost --port 8000 --accessKey a --secretKey a --prefixSeparator "" |
| 56 | + rm -rf dump/test* |
| 57 | + python dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a --secretKey a --prefixSeparator "" |
| 58 | + python test/test.py |
0 commit comments