Set retain_repo_versions: 1
to validated
repository
#3027
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Galaxy Collection CI | |
on: | |
pull_request: | |
branches: | |
- "*" | |
paths-ignore: | |
- "CHANGES/**" | |
- "docs/**" | |
- "mkdocs.yml" | |
push: | |
branches: | |
- "*" | |
workflow_dispatch: | |
env: | |
PY_COLORS: '1' | |
ANSIBLE_FORCE_COLOR: '1' | |
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: (Linux) Install docker compose | |
run: | | |
curl -L -o /tmp/docker-compose https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 | |
install /tmp/docker-compose /usr/local/bin/ | |
- name: install ansible | |
run: pip3 install ansible | |
- name: Checkout the ansible_hub collection | |
uses: actions/checkout@v4 | |
with: | |
repository: ansible-collections/ansible_hub | |
path: ansible_hub | |
- name: copy galaxy.yml.j2 to ansible_hub | |
run: | | |
cp dev/galaxy_collection_plays/galaxy.yml.j2 ansible_hub | |
- name: Build and install the collection | |
working-directory: ansible_hub | |
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 | |
ansible all -i localhost, -c local -m template -a "src=galaxy.yml.j2 dest=galaxy.yml" -e collection_namespace=ansible -e collection_name=hub -e collection_version=1.0.0 -e collection_repo=https://github.com/ansible-collections/ansible_hub | |
ansible-galaxy collection build -vvv | |
ansible-galaxy collection install ansible-hub-1.0.0.tar.gz -vvv | |
- name: (Linux) Install docker compose | |
run: | | |
curl -L -o /tmp/docker-compose https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 | |
install /tmp/docker-compose /usr/local/bin/ | |
- name: sudo apt update | |
run: | | |
sudo apt update | |
- name: Install python requirements and podman | |
run: | | |
sudo apt-get install -y libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev podman | |
- name: Spin up dev/compose/standalone.yaml | |
run: | | |
docker compose -f dev/compose/standalone.yaml up --detach | |
- name: Export environment variables to host | |
run: | | |
docker compose -f dev/compose/standalone.yaml exec manager /bin/bash -c 'env | grep -v -w "HOME"' >> $GITHUB_ENV | |
- run: cat $GITHUB_ENV | |
- name: Wait for API online status | |
run: | | |
max_runs=10 | |
for i in $(seq 1 $max_runs); do | |
echo "$i: checking api status..." | |
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -u "${{ env.DJANGO_SUPERUSER_USERNAME }}:${{ env.DJANGO_SUPERUSER_PASSWORD }}" -LI http://localhost:5001/api/galaxy/pulp/api/v3/status/) | |
if [ "$RESPONSE" -ne 200 ]; then | |
echo "API is down. Retrying in 10 seconds..." | |
sleep 10 | |
else | |
echo "API online." | |
exit 0 | |
fi | |
done | |
- name: create the test users+data | |
run: docker exec -t compose-manager-1 bash -c 'cd /src/galaxy_ng; django-admin shell < ./dev/common/setup_test_data.py' | |
- name: make messages | |
run: docker exec -t compose-manager-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 | |
- name: Logs | |
if: always() | |
run: | | |
set +e | |
docker ps -a | |
echo ::group::MANAGER_LOGS | |
docker logs --tail=10000 compose-manager-1 | |
echo ::endgroup:: | |
echo ::group::WORKER_LOGS | |
docker logs --tail=10000 compose-worker-1 | |
echo ::endgroup:: | |
echo ::group::CONTENT_LOGS | |
docker logs --tail=10000 compose-content-1 | |
echo ::endgroup:: | |
echo ::group::API_LOGS | |
docker logs --tail=10000 compose-api-1 | |
echo ::endgroup:: | |
echo ::group::DEPENDENCIES | |
docker exec compose-manager-1 bash -c "pip list && pip install pipdeptree && pipdeptree" | |
echo ::endgroup:: |