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 CI workflow to test galaxy_collection against the dab_jwt #2160

Closed
Closed
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
93 changes: 93 additions & 0 deletions .github/workflows/ci_automation_hub_collection_dab_jwt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
name: Galaxy Collection CI - dab_jwt
on:
pull_request:
branches:
- "*"
paths-ignore:
- "CHANGES/**"
- "docs/**"
- "mkdocs.yml"
push:
branches:
- "*"
workflow_dispatch:

jobs:
galaxy_collection:
runs-on: ubuntu-latest
steps:
- name: Checkout galaxy_ng
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: install ansible
run: pip3 install ansible

- name: Checkout the galaxy collection
uses: actions/checkout@v4
with:
repository: bmclaughlin/galaxy_collection
branch: bugfix-get-galaxy-path-prefix
path: galaxy_collection

- name: Build and install the collection
working-directory: galaxy_collection
run: |
# The ansible.cfg defined in the collection repository might break the test. We want the same variables for installation and running.
rm -f ansible.cfg
rm -f galaxy.yml
mv .github/files/galaxy.yml.j2 .
ansible all -i localhost, -c local -m template -a "src=galaxy.yml.j2 dest=galaxy.yml" -e collection_namespace=galaxy -e collection_name=galaxy -e collection_version=1.0.0 -e collection_repo=https://github.com/ansible/automation_hub_collection
ansible-galaxy collection build -vvv
ansible-galaxy collection install galaxy-galaxy-1.0.0.tar.gz -vvv

#- name: Spin up a standalone galaxy_ng installation
# run: |
# echo "COMPOSE_PROFILE=standalone" > .compose.env
# echo "DEV_SOURCE_PATH=galaxy_ng" >> .compose.env
# make docker/all
# ./compose up -d
# pip3 install --upgrade requests pyyaml
# python3 dev/common/poll.py

- name: set env vars
run: |
echo "OCI_ENV_PATH=${HOME}/work/galaxy_ng/oci_env" >> $GITHUB_ENV
echo "COMPOSE_INTERACTIVE_NO_CLI=1" >> $GITHUB_ENV
echo "OCI_VERBOSE=1" >> $GITHUB_ENV
echo "GH_DUMP_LOGS=0" >> $GITHUB_ENV

- name: setup oci-env
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: run the dab_jwt stack detached
run: OCI_COMPOSE_DETACH=1 make oci/dab_jwt

- name: wait for the system to start
run: make oci/dab_jwt/poll

- name: create the test users+data
run: docker exec -t ci-dab-proxy_pulp_1 bash -c 'cd /src/galaxy_ng; django-admin shell < ./dev/common/setup_test_data.py'

- name: make messages
run: docker exec -t ci-dab-proxy_pulp_1 bash -c 'cd /src/galaxy_ng/galaxy_ng; django-admin makemessages --all'

- name: Test the user playbook
run: ansible-playbook dev/galaxy_collection_plays/user.yml -vvv

- name: Test the content playbook
run: ansible-playbook dev/galaxy_collection_plays/content.yml -vvv

- name: Test the repo playbook
run: ansible-playbook dev/galaxy_collection_plays/repo.yml -vvv

- name: Test the ee playbook
run: ansible-playbook dev/galaxy_collection_plays/ee.yml -vvv
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ oci/standalone:
oci/standalone/poll:
dev/oci_poll standalone

.PHONY: oci/dab_jwt/poll
oci/dab_jwt/poll:
dev/oci_poll dab_jwt

.PHONY: oci/insights
oci/insights:
dev/oci_start insights
Expand Down
Loading