fix: workflows (#43) #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Run Test Playbooks Minikube | |
on: [push] | |
jobs: | |
Integration-test: | |
name: Deploy Tower to Minikube and run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: "Install dependencies" | |
run: pip install -r .github/requirements.txt | |
- name: Setup Minikube | |
uses: manusa/[email protected] | |
with: | |
minikube version: 'v1.21.0' | |
kubernetes version: 'v1.20.7' | |
start args: '--addons=ingress' | |
- name: Sleep for 20 seconds | |
run: sleep 20s | |
shell: bash | |
- name: Setup awx operator | |
run: | | |
minikube kubectl create secret generic awx-admin-password -- --from-literal=password=password | |
minikube addons enable ingress | |
alias kubectl="minikube kubectl --" | |
- name: kustomize awx operator | |
working-directory: .github/workflow-config | |
run: kustomize build . | kubectl apply -f - | |
- name: Sleep for 30 seconds | |
run: sleep 30s | |
shell: bash | |
- name: kustomize awx | |
working-directory: .github/workflow-config/kube | |
run: kustomize build . | kubectl apply -f - | |
- name: Sleep for 30 seconds | |
run: sleep 30s | |
shell: bash | |
- name: Check service URL | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 25 | |
retry_wait_seconds: 30 | |
command: minikube service awx-service --url | |
- name: minikube kubectl get pods | |
run: minikube kubectl get pods | |
- name: Set service url | |
run: echo 'SERVICEURL=$(minikube service awx-service --url)' >> $GITHUB_OUTPUT | |
id: service-url | |
- name: Display service url | |
run: echo "Service URL is ${{ steps.service-url.outputs.SERVICEURL }}" | |
- name: Display Versions | |
run: which python && pip --version && ansible --version | |
# - name: Add cloud/galaxy tokens | |
# run: echo -e "${{ secrets.galaxy_token }}" >> ansible.cfg | |
- name: Fixing orgs | |
run: echo -e "${{ secrets.fix_orgs }}" > group_vars/all/organizations.yml | |
# Doesn't appear to be working at this moment | |
- name: Fix cloud cred | |
run: sed -i "s/url\:\ \"https\:\/\/{{ ah_host }}\/api\/galaxy\/content\/rh-certified\/\"/url\:\ https\:\/\/console\.redhat\.com\/api\/automation-hub\/content\/5910538-synclist\//g" group_vars/all/credentials.yml | |
# Doesn't appear to be working at this moment | |
- name: Fix cloud cred token | |
run: sed -i "s/{{ ah_token }}/${{ secrets.cloud_token }}/g" group_vars/all/credentials.yml | |
- name: Verify fixes | |
run: cat group_vars/all/organizations.yml; cat group_vars/all/credentials.yml | |
- name: "Install Galaxy dependencies" | |
run: ansible-galaxy collection install -r collections/requirements.yml | |
- name: Sleep for 300 seconds | |
run: sleep 300s | |
shell: bash | |
- name: "Perform playbook tests" | |
run: ansible-playbook playbooks/controller_config.yml -i inventory_ci.yml -l dev -e controller_host=${{ steps.service-url.outputs.SERVICEURL }} -e controller_pass=password -e validate_certs=false -e ah_token=skip | |
... |