Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cleanup(test) to run regardless of deployment #40

Merged
merged 6 commits into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:

build-and-push-container-images:
name: Build and push container images
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change to a lower version ?
Ubuntu 22 to Ubuntu 20 ?
Something python related?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: github.event_name == 'release' || (github.event_name == 'push' && github.ref_name == 'main')
needs: [ansible-lint]
needs: [ansible-lint, deploy-test-rpm]
permissions:
contents: read
packages: write
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:

deploy-test-rpm:
name: Run the playbook on SLES 15 ${{ matrix.sp_version }}
runs-on: ubuntu-22.04
needs: [build-and-push-container-images]
needs: [ansible-lint]
runs-on: ubuntu-20.04
strategy:
matrix:
include:
Expand All @@ -86,6 +86,7 @@ jobs:
- name: Install galaxy deps
run: ansible-galaxy install -r requirements.yml
- name: Run playbook
id: runplaybook
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: playbook.yml
Expand All @@ -94,6 +95,7 @@ jobs:
all:
vars:
ansible_user: ${{ secrets.TEST_HOST_USER }}
ansible_python_interpreter: /usr/bin/python3
children:
trento-server:
hosts:
Expand Down Expand Up @@ -125,13 +127,15 @@ jobs:
run: curl -k "https://${{ env.TEST_HOST_IP }}/api/readyz"
- name: Run playbook cleanup
uses: dawidd6/action-ansible-playbook@v2
if: success() || steps.runplaybook.conclusion == 'failure'
with:
playbook: playbook.cleanup.yml
key: ${{ secrets.SSH_MACHINE_KEY }}
inventory: |
all:
vars:
ansible_user: ${{ secrets.TEST_HOST_USER }}
ansible_python_interpreter: /usr/bin/python3
children:
trento-server:
hosts:
Expand Down Expand Up @@ -162,7 +166,7 @@ jobs:

create-artifact:
runs-on: ubuntu-20.04
needs: [ansible-lint]
needs: [ansible-lint, deploy-test-rpm]
steps:
- uses: actions/checkout@v3
with:
Expand Down
Loading