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

WIP - Add integration tests splitter github actions #1391

Closed
wants to merge 1 commit into from
Closed
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
50 changes: 50 additions & 0 deletions .github/workflows/test-splitter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Integration tests splitter
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

on:
pull_request:
branches:
- main
- 'stable-*'
tags:
- '*'
workflow_dispatch:

jobs:
test_splitter:
name: list test targets
env:
source_directory: "./source"
dependent_directory: "./dependency"
runs-on: ubuntu-latest
outputs:
test_targets: ${{ steps.display.outputs.test_targets }}
steps:
- name: Checkout the collection repository
uses: actions/checkout@v3
with:
path: ${{ env.source_directory }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Checkout the community.aws collection repository
uses: actions/checkout@v3
with:
repository: ansible-collections/community.aws
path: ${{ env.dependent_directory }}
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
Comment on lines +25 to +38
Copy link
Member

Choose a reason for hiding this comment

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

I think the collection and collection dependencies install should be handled in a separate job, or more likely a separate reusable workflow. We are reinventing the wheel here with every workflow/action, and each time we do it differently. The docs-build seems to do this its own way, the network sanity workflow does this its own way, and then we're adding a new way of doing it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am working on something that can take care of the dependencies resolution, the collection and collection dependencies install will be done with the depends-on feature we used to add with zuul


- name: list changes for pull request
id: splitter
uses: abikouo/github_actions/.github/actions/cloud_integration_test_splitter@main
with:
collection_path: ${{ env.source_directory }},${{ env.dependent_directory }}
base_ref: ${{ github.event.pull_request.base.ref }}

- name: display targets
id: display
run: echo "test_targets=${{ steps.splitter.outputs.test_targets }}" >> $GITHUB_OUTPUT
shell: bash