Skip to content

Commit

Permalink
Run unit tests before a new release
Browse files Browse the repository at this point in the history
  • Loading branch information
maxisoft committed Aug 14, 2020
1 parent f23c25a commit 2de4bb1
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,29 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'

- uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install deps
run: |
pip install -r test-requirements.txt &&
pip install -e .
timeout-minutes: 3

- name: Run python unit tests
run: python -m unittest discover -s ./freenom_dns_updater/test
timeout-minutes: 20

release:
needs: [test]
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down Expand Up @@ -93,8 +114,7 @@ jobs:

publish:
# from https://github.com/actions/create-release/issues/14#issuecomment-555379810
if: contains(github.ref, 'tags/v')
needs: [release]
needs: [test, release]
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand All @@ -110,10 +130,6 @@ jobs:
with:
name: release_url

- uses: actions/checkout@v2
with:
submodules: 'recursive'

- uses: actions/setup-python@v2
with:
python-version: '3.x'
Expand All @@ -140,6 +156,7 @@ jobs:
python ./waf distclean all
cd ..
python setup.py install
cd ..
- name: Build the executable
run: |
Expand Down Expand Up @@ -170,5 +187,5 @@ jobs:
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./${{ runner.os }}.zip
asset_name: ${{ steps.get_release_info.outputs.file_name }}-${{ runner.os }}.zip
asset_name: ${{ steps.get_release_info.outputs.file_name }}-${{ matrix.os }}.zip
asset_content_type: application/zip

0 comments on commit 2de4bb1

Please sign in to comment.