Skip to content

Commit

Permalink
Adding new CI workflow to test the changes made in ansible#403
Browse files Browse the repository at this point in the history
  • Loading branch information
bmclaughlin committed Jun 7, 2024
1 parent 548c17e commit c1608a7
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/files/dab_jwt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import action_lib

env = action_lib.OCIEnvIntegrationTest(
envs=[
{
"env_file": "dab_jwt.compose.env",
"run_tests": False,
"db_restore": None,
"test_script": "/src/galaxy_ng/profiles/dab_jwt/run_integration.sh"
}
]
)
18 changes: 18 additions & 0 deletions .github/workflows/ci_dab_jwt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Test roles and modules
on: [push, pull_request_target]

jobs:
ci_dab:
strategy:
fail-fast: false
matrix:
galaxy_ng_version:
- master
uses: "./.github/workflows/ci_dab_jwt_versioned.yml"
with:
galaxy_ng_version: ${{ matrix.galaxy_ng_version }}
gh_ref: ${{ github.event.pull_request.head.sha || github.sha }}
secrets:
redhat_catalog_username: ${{ secrets.REDHAT_CATALOG_USERNAME }}
redhat_catalog_password: ${{ secrets.REDHAT_CATALOG_PASSWORD }}
92 changes: 92 additions & 0 deletions .github/workflows/ci_dab_jwt_versioned.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
name: Test roles and modules with galaxy_ng

on:
workflow_call:
inputs:
galaxy_ng_version:
description: The version to pull of galaxy_ng
required: true
type: string
gh_ref:
description: The ref in the repository to pull
required: false
default: devel
type: string
secrets:
redhat_catalog_username:
description: Username for Red Hat Catalog
required: true
redhat_catalog_password:
description: Password for Red Hat Catalog
required: true

jobs:

integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.gh_ref }}

- name: Move ansible.cfg to root
run: mv .github/files/ansible.cfg .

- name: Build and install the collection
id: build
uses: redhat-cop/ansible_collections_tooling/actions/build_ansible_collection@main
with:
collection_namespace: galaxy
collection_name: galaxy
collection_version: 1.0.0
collection_repo: https://github.com/ansible/galaxy_collection

- name: "Checkout galaxy_ng"
uses: actions/checkout@v2
with:
repository: ansible/galaxy_ng
path: galaxy_ng
ref: ${{ inputs.galaxy_ng_version }}

# Note: COMPOSE_INTERACTIVE_NO_CLI=1 is required for oci-env to work correctly when there's no interactive terminal
- name: Set environment variables
working-directory: galaxy_ng
run: |
echo "OCI_ENV_PATH=${GITHUB_WORKSPACE}/oci_env" >> $GITHUB_ENV
echo "COMPOSE_INTERACTIVE_NO_CLI=1" >> $GITHUB_ENV
echo "OCI_VERBOSE=1" >> $GITHUB_ENV
echo "GH_DUMP_LOGS=1" >> $GITHUB_ENV
echo "GH_TEARDOWN=0" >> $GITHUB_ENV
- name: Update apt
run: sudo apt -y update

- name: Install LDAP requirements
run: sudo apt-get install -y libsasl2-dev python3 libldap2-dev libssl-dev build-essential

- name: setup oci-env
working-directory: galaxy_ng
run: |
git clone https://github.com/pulp/oci_env.git $OCI_ENV_PATH
pip install -e $OCI_ENV_PATH/client/
mkdir $OCI_ENV_PATH/db_backup/
- name: Move ci cfg to oci
run: mv .github/files/dab_jwt.py ./galaxy_ng/dev/oci_env_integration/actions/dab_gwt.py

- name: Stand up galaxy_ng
working-directory: galaxy_ng
run: python3 dev/oci_env_integration/actions/ci.py

- name: "Perform playbook user and group management tests"
run: ansible-playbook tests/playbooks/testing_playbook_user.yml -v -e galaxy_ng_version=${{ inputs.galaxy_ng_version }}

- name: "Perform playbook collection tests"
run: ansible-playbook tests/playbooks/testing_collections_playbook.yml -v -e galaxy_ng_version=${{ inputs.galaxy_ng_version }} -e git_repo_name=${{ github.event.repository.name }}

- name: "Perform collection repository tests"
run: ansible-playbook tests/playbooks/testing_collections_repos.yml -v -e galaxy_ng_version=${{ inputs.galaxy_ng_version }}

- name: "Perform playbook repository tests"
run: ansible-playbook tests/playbooks/testing_playbook_ee_repository.yml -vv -e galaxy_ng_version=${{ inputs.galaxy_ng_version }} -e redhat_catalog_username=${{ secrets.redhat_catalog_username }} -e redhat_catalog_password=${{ secrets.redhat_catalog_password }}
4 changes: 4 additions & 0 deletions changelogs/fragments/add_new_ci_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
minor_changes:
- Add new CI workflow to test Galaxy api prefix supplied from resource_provider (#403).
...

0 comments on commit c1608a7

Please sign in to comment.