From aab016432ea1eb3dae5ba6abf670d76a7222f36e Mon Sep 17 00:00:00 2001 From: James Turk Date: Mon, 12 Oct 2020 16:35:06 -0400 Subject: [PATCH] github action to test --- .github/workflows/test.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6c71be9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test Scripts + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + services: + redis: + image: redis + ports: + - 6379:6379 + + steps: + # Python & dependency installation + - uses: actions/checkout@v2 + - name: setup Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: install Poetry + uses: dschep/install-poetry-action@v1.3 + - name: cache Poetry virtualenv + uses: actions/cache@v2 + id: cache + with: + path: ~/.virtualenvs/ + key: poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ hashFiles('**/poetry.lock') }} + - name: set poetry config path + run: poetry config virtualenvs.path ~/.virtualenvs + - name: install dependencies + run: poetry install + # if: steps.cache.outputs.cache-hit != 'true' + + - name: lint with flake8 + run: poetry run flake8 . --show-source --statistics --ignore=E203,E501 + - name: pytest + run: poetry run pytest