Skip to content

Commit

Permalink
moved pip-build-test to release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Jan 17, 2024
1 parent aaacf89 commit ef8b830
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 3
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -22,7 +22,35 @@ jobs:
python-version: '3.10'

- name: Install dependencies
run: pip install -r requirements_build.txt >/dev/null
run: |
pip install -r requirements_build.txt >/dev/null
pip install -r requirements.txt >/dev/null
shell: bash

- name: Testing to build Ansible-WebUI with PIP
run: |
cd /tmp
echo 'CREATING TMP VENV'
tmp_venv="/tmp/ansible-webui-venv/$(date +%s)"
python3 -m virtualenv "$tmp_venv" >/dev/null
source "${tmp_venv}/bin/activate"
echo 'INSTALLING MODULE'
python3 -m pip install -e "$GITHUB_WORKSPACE" >/dev/null
set +e
echo 'RUNNING APP'
timeout 2 python3 -m ansible-webui
ec="$?"
echo 'CLEANUP'
deactivate
rm -rf "$tmp_venv"
if [[ "$ec" != "124" ]]
then
exit 1
fi
shell: bash

- name: Extract tag name
Expand Down
28 changes: 1 addition & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 3
timeout-minutes: 2

steps:
- name: Checkout
Expand Down Expand Up @@ -69,29 +69,3 @@ jobs:
- name: Running Tests
run: python3 -m pytest
shell: bash

- name: Testing to build Ansible-WebUI with PIP
run: |
cd /tmp
echo 'CREATING TMP VENV'
tmp_venv="/tmp/ansible-webui-venv/$(date +%s)"
python3 -m virtualenv "$tmp_venv" >/dev/null
source "${tmp_venv}/bin/activate"
echo 'INSTALLING MODULE'
python3 -m pip install -e "$GITHUB_WORKSPACE" >/dev/null
set +e
echo 'RUNNING APP'
timeout 2 python3 -m ansible-webui
ec="$?"
echo 'CLEANUP'
deactivate
rm -rf "$tmp_venv"
if [[ "$ec" != "124" ]]
then
exit 1
fi
shell: bash

0 comments on commit ef8b830

Please sign in to comment.