Skip to content
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
61 changes: 61 additions & 0 deletions .github/workflows/release-cross-repo-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release Ansible cross repository test

on:
pull_request:
branches:
- main
types: [opened] # Workflow will only be executed when PR is opened to main branch
workflow_dispatch: # Manual trigger


jobs:
ansible_integration_test:
runs-on: ubuntu-latest
steps:
- name: Checkout linode_api4 repository
uses: actions/checkout@v4

- name: update packages
run: sudo apt-get update -y

- name: install make
run: sudo apt-get install -y build-essential

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install linode_api4
run: make install

- name: checkout repo
uses: actions/checkout@v3
with:
repository: linode/ansible_linode
path: .ansible/collections/ansible_collections/linode/cloud

- name: install dependencies
run: |
cd .ansible/collections/ansible_collections/linode/cloud
pip install -r requirements.txt -r requirements-dev.txt --upgrade-strategy only-if-needed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just for some added confidence, would it make sense to install linode_api4 after installing the Ansible Collection deps?

@ykim-akamai ykim-akamai Mar 12, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I verified that the one built is being used in my local environment

╰─➤  pip install linode_api4 --upgrade-strategy only-if-needed
Requirement already satisfied: linode_api4 in ./venv/lib/python3.10/site-packages (0.0.0.dev0)
Requirement already satisfied: requests in ./venv/lib/python3.10/site-packages (from linode_api4) (2.31.0)

I think doing it after might be complicated considering it will be overwritten


- name: install ansible dependencies
run: ansible-galaxy collection install amazon.aws:==6.0.1

- name: install collection
run: |
cd .ansible/collections/ansible_collections/linode/cloud
make install

- name: replace existing keys
run: |
cd .ansible/collections/ansible_collections/linode/cloud
rm -rf ~/.ansible/test && mkdir -p ~/.ansible/test && ssh-keygen -m PEM -q -t rsa -N '' -f ~/.ansible/test/id_rsa

- name: run tests
run: |
cd .ansible/collections/ansible_collections/linode/cloud
make testall
env:
LINODE_API_TOKEN: ${{ secrets.LINODE_TOKEN }}