Skip to content

.github/workflows/ansible-tests-pr.yml #28

.github/workflows/ansible-tests-pr.yml

.github/workflows/ansible-tests-pr.yml #28

on:
pull_request_target:
paths:
- config
- equinix_metal
- templates
- metal_openapi.fixed.yaml
- oas3.stitched
- oas3.fetched
- .github/**
workflow_dispatch:
permissions:
pull-requests: read
contents: read
jobs:
authorize:
environment:
${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository &&
'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
integration-test-pr:
needs: authorize
runs-on: ubuntu-latest
steps:
- name: update packages
run: sudo apt-get update -y
- name: install make
run: sudo apt-get install -y build-essential
- name: setup python 3
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: checkout Python SDK, this PR
uses: actions/checkout@v4
with:
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: python3 -m pip install ./equinix_metal
- 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 }}