Skip to content

Commit 512f6a4

Browse files
authored
ci: migrate ci to github actions (#65)
- Add GitHub actions workflow - Remove Travis CI yaml - Update badge status in readme
1 parent deee239 commit 512f6a4

File tree

3 files changed

+59
-34
lines changed

3 files changed

+59
-34
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dynamodump
22
==========
33

4-
[![Buildstatus](https://travis-ci.org/bchew/dynamodump.svg)](https://travis-ci.org/bchew/dynamodump) [![DockerBuildstatus](https://img.shields.io/docker/build/bchew/dynamodump.svg)](https://hub.docker.com/r/bchew/dynamodump/)
4+
![Build Status](https://github.com/bchew/dynamodump/workflows/Python%20package/badge.svg) [![DockerBuildstatus](https://img.shields.io/docker/build/bchew/dynamodump.svg)](https://hub.docker.com/r/bchew/dynamodump/)
55

66
Simple backup and restore script for Amazon DynamoDB using boto to work similarly to mysqldump.
77

0 commit comments

Comments
 (0)