Skip to content

Commit

Permalink
Merge pull request #7 from uw-it-aca/feature/test-steps
Browse files Browse the repository at this point in the history
updates test/publish workflows
  • Loading branch information
jlaney authored Jan 20, 2021
2 parents a57636d + 7774579 commit 590f2a9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 99 deletions.
42 changes: 34 additions & 8 deletions examples/django-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,39 @@ jobs:
with:
python-version: 3.6

- name: Test App
uses: uw-it-aca/actions/test-django-app@v1
with:
app_name: ${APP_NAME}
conf_path: ${CONF_PATH}
django_version: ${{ matrix.django-version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: |
sudo apt-get install python-dev libxml2-dev libxmlsec1-dev
python -m pip install --upgrade pip
pip install -e .
pip install pycodestyle coverage coveralls==2.2.0
- name: Upgrade Django Version
run: pip install "Django~=${{ matrix.django-version }}.0"

- name: Setup Django
run: |
django-admin startproject project .
test -f ${CONF_PATH}/urls.py && cp ${CONF_PATH}/urls.py project/
test -f ${CONF_PATH}/settings.py && cat ${CONF_PATH}/settings.py >> project/settings.py
- name: Run Linters
run: pycodestyle ${APP_NAME}/

- name: Run Migrations
run: python manage.py migrate

- name: Run Tests
run: |
python -m compileall ${APP_NAME}/
coverage run --source=${APP_NAME}/ manage.py test ${APP_NAME}
- name: Test Coverage
if: matrix.django-version == 2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: coveralls

publish:
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
Expand All @@ -83,7 +109,7 @@ jobs:
python-version: '3.x'

- name: Publish to PyPi
uses: uw-it-aca/actions/publish-pypi@v1
uses: uw-it-aca/actions/publish-pypi@main
with:
app_name: ${APP_NAME}
tag_name: ${{ github.event.release.tag_name }}
Expand Down
2 changes: 1 addition & 1 deletion examples/python-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
python-version: '3.x'

- name: Publish to PyPi
uses: uw-it-aca/actions/publish-pypi@v1
uses: uw-it-aca/actions/publish-pypi@main
with:
app_name: ${APP_NAME}
tag_name: ${{ github.event.release.tag_name }}
Expand Down
56 changes: 0 additions & 56 deletions test-django-app/action.yml

This file was deleted.

34 changes: 0 additions & 34 deletions test-python-app/action.yml

This file was deleted.

0 comments on commit 590f2a9

Please sign in to comment.