|
| 1 | +name: Release Ansible cross repository test |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + types: [opened] # Workflow will only be executed when PR is opened to main branch |
| 8 | + workflow_dispatch: # Manual trigger |
| 9 | + |
| 10 | + |
| 11 | +jobs: |
| 12 | + ansible_integration_test: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout linode_api4 repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: update packages |
| 19 | + run: sudo apt-get update -y |
| 20 | + |
| 21 | + - name: install make |
| 22 | + run: sudo apt-get install -y build-essential |
| 23 | + |
| 24 | + - name: Set up Python |
| 25 | + uses: actions/setup-python@v4 |
| 26 | + with: |
| 27 | + python-version: '3.10' |
| 28 | + |
| 29 | + - name: checkout repo |
| 30 | + uses: actions/checkout@v3 |
| 31 | + with: |
| 32 | + repository: linode/ansible_linode |
| 33 | + path: .ansible/collections/ansible_collections/linode/cloud |
| 34 | + |
| 35 | + - name: install dependencies |
| 36 | + run: | |
| 37 | + cd .ansible/collections/ansible_collections/linode/cloud |
| 38 | + pip install -r requirements.txt -r requirements-dev.txt --upgrade-strategy only-if-needed |
| 39 | +
|
| 40 | + - name: install ansible dependencies |
| 41 | + run: ansible-galaxy collection install amazon.aws:==6.0.1 |
| 42 | + |
| 43 | + - name: install collection |
| 44 | + run: | |
| 45 | + cd .ansible/collections/ansible_collections/linode/cloud |
| 46 | + make install |
| 47 | +
|
| 48 | + - name: Install linode_api4 # Need to install from source after all ansible dependencies have been installed |
| 49 | + run: make install |
| 50 | + |
| 51 | + - name: replace existing keys |
| 52 | + run: | |
| 53 | + cd .ansible/collections/ansible_collections/linode/cloud |
| 54 | + rm -rf ~/.ansible/test && mkdir -p ~/.ansible/test && ssh-keygen -m PEM -q -t rsa -N '' -f ~/.ansible/test/id_rsa |
| 55 | +
|
| 56 | + - name: Run Ansible Tests |
| 57 | + run: | |
| 58 | + cd .ansible/collections/ansible_collections/linode/cloud |
| 59 | + make testall |
| 60 | + env: |
| 61 | + LINODE_API_TOKEN: ${{ secrets.LINODE_TOKEN }} |
0 commit comments