Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add manual trigger for integration test workflow for PRs #109

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
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
57 changes: 57 additions & 0 deletions .github/workflows/integration-tests-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
on:
pull_request_target:
paths:
- plugins
- tests
- Makefile
- requirements.txt
- requirements-dev.txt
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:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- 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@v4
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: run tests
run: make testall
env:
METAL_API_TOKEN: ${{ secrets.METAL_API_TOKEN }}

5 changes: 4 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on:
paths-ignore:
- '**.md'
- 'docs'
- LICENSE
- LICENSE
branches:
- main

# pull_request:
# types: [review_requested,opened,reopened,synchronize]

Expand Down