Skip to content

Commit

Permalink
fix: fixes in GH action for integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mk committed Jan 15, 2024
1 parent 791cc61 commit 78e292c
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions .github/workflows/ansible-tests-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
pull_request_target:
paths:
- config
Expand Down Expand Up @@ -27,17 +27,7 @@ jobs:
integration-test-pr:
needs: authorize
runs-on: ubuntu-latest
defaults:
run:
working-directory: .ansible/collections/ansible_collections/equinix/cloud
steps:
- name: checkout Ansible collection
uses: actions/checkout@v4
with:
name: equinix-labs/ansible-collection-equinix
path: .ansible/collections/ansible_collections/equinix/cloud
ref: ${{ github.event.pull_request.head.sha || github.ref }}

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

Expand All @@ -49,26 +39,33 @@ jobs:
with:
python-version: '3.8'

- name: install dependencies
run: pip3 install -r requirements-dev.txt -r requirements.txt

- name: install collection
run: make install

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

- name: checkout Python SDK, this PR
uses: actions/checkout@v4
with:
path: /tmp/metal-python
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: checkout Ansible collection
uses: actions/checkout@v4
with:
repository: equinix-labs/ansible-collection-equinix
path: .ansible/collections/ansible_collections/equinix/cloud
ref: main

- name: install dependencies of ansible collection
run: pip3 install -r requirements-dev.txt -r requirements.txt
working-directory: .ansible/collections/ansible_collections/equinix/cloud

- name: install cloned Python SDK
run: python -m pip install /tmp/metal-python/equinix_metal
run: python3 -m pip install ./equinix_metal

- name: run tests

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

- name: run tests in ansible collection directory
run: make testall
working-directory: .ansible/collections/ansible_collections/equinix/cloud
env:
METAL_API_TOKEN: ${{ secrets.METAL_API_TOKEN }}

0 comments on commit 78e292c

Please sign in to comment.