Skip to content

Commit

Permalink
Merge pull request #33 from trento-project/add-ci-test
Browse files Browse the repository at this point in the history
Add RPM tests for SP3, SP4, SP5
  • Loading branch information
rtorrero authored Apr 26, 2024
2 parents 269d70b + 621aac6 commit 8d9a4e6
Showing 1 changed file with 99 additions and 3 deletions.
102 changes: 99 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

- name: Run ansible-lint
uses: ansible/ansible-lint-action@v6

build-and-push-container-images:
name: Build and push container images
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.event_name == 'release' || (github.event_name == 'push' && github.ref_name == 'main')
needs: [ansible-lint]
permissions:
Expand Down Expand Up @@ -62,6 +62,103 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

deploy-test-rpm:
name: Run the playbook on SLES 15 ${{ matrix.sp_version }}
runs-on: ubuntu-22.04
needs: [build-and-push-container-images]
strategy:
matrix:
include:
- sp_version: 'SP3'
host_ip: TEST_SP3_HOST_IP
- sp_version: 'SP4'
host_ip: TEST_SP4_HOST_IP
- sp_version: 'SP5'
host_ip: TEST_SP5_HOST_IP
env:
TEST_HOST_IP: ${{ secrets[matrix.host_ip] }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install galaxy deps
run: ansible-galaxy install -r requirements.yml
- name: Run playbook
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: playbook.yml
key: ${{ secrets.SSH_MACHINE_KEY }}
inventory: |
all:
vars:
ansible_user: ${{ secrets.TEST_HOST_USER }}
children:
trento-server:
hosts:
server:
ansible_host: ${{ env.TEST_HOST_IP }}
postgres-hosts:
hosts:
server:
ansible_host: ${{ env.TEST_HOST_IP }}
rabbitmq-hosts:
hosts:
server:
ansible_host: ${{ env.TEST_HOST_IP }}
options: |
--extra-vars "web_postgres_password='trento' \
wanda_postgres_password='wanda' \
rabbitmq_password='trento' \
prometheus_url='http://localhost' \
trento_server_name='trento-deployment.example.com' \
web_admin_password='adminpassword' \
enable_api_key='false' \
nginx_vhost_listen_port='443' \
nginx_ssl_cert_as_base64='true' \
nginx_ssl_key_as_base64='true' \
nginx_ssl_cert='${{ secrets.SSL_CERT }}' \
nginx_ssl_key='${{ secrets.SSL_KEY }}' \
install_method='rpm'"
- name: Test readiness
run: curl -k "https://${{ env.TEST_HOST_IP }}/api/readyz"
- name: Run playbook cleanup
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: playbook.cleanup.yml
key: ${{ secrets.SSH_MACHINE_KEY }}
inventory: |
all:
vars:
ansible_user: ${{ secrets.TEST_HOST_USER }}
children:
trento-server:
hosts:
server:
ansible_host: ${{ env.TEST_HOST_IP }}
postgres-hosts:
hosts:
server:
ansible_host: ${{ env.TEST_HOST_IP }}
rabbitmq-hosts:
hosts:
server:
ansible_host: ${{ env.TEST_HOST_IP }}
options: |
--extra-vars "web_postgres_password='trento' \
wanda_postgres_password='wanda' \
rabbitmq_password='trento' \
prometheus_url='http://localhost' \
trento_server_name='trento-deployment.example.com' \
web_admin_password='adminpassword' \
enable_api_key='false' \
nginx_vhost_listen_port='443' \
nginx_ssl_cert_as_base64='true' \
nginx_ssl_key_as_base64='true' \
nginx_ssl_cert='${{ secrets.SSL_CERT }}' \
nginx_ssl_key='${{ secrets.SSL_KEY }}' \
install_method='rpm'"
create-artifact:
runs-on: ubuntu-20.04
needs: [ansible-lint]
Expand Down Expand Up @@ -108,4 +205,3 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: trento-ansible.tgz
tag: ${{ github.ref }}

0 comments on commit 8d9a4e6

Please sign in to comment.