Skip to content

Commit

Permalink
Merge pull request #40 from trento-project/always-run-cleanup
Browse files Browse the repository at this point in the history
Allow cleanup(test) to run regardless of deployment
  • Loading branch information
arbulu89 authored Jul 16, 2024
2 parents 286ee23 + d710957 commit 57169f5
Showing 1 changed file with 9 additions and 5 deletions.
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
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

0 comments on commit 57169f5

Please sign in to comment.