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

CI: Implement GitHub action cache in pull-request-management workflow (WORK IN PROGRESS) #4778

Draft
wants to merge 39 commits into
base: devel
Choose a base branch
from

Conversation

Shivani-gslab
Copy link
Contributor

@Shivani-gslab Shivani-gslab commented Dec 3, 2024

Change Summary

WORK IN PROGRESS
Implementing github action cache for pull-request-management workflow.

Testing multiple approaches here -

Points to be tested -

  • Test if cache-hit conditon works with setup-python cache: pip or not and do not skip package upgrade -> the condition does not work as expected.
  • Try creating single job for caching the common requirements and reuse that cache in each job. (need to check if we can get the cache-key from setup-python action, else try using actions/cache@v3. --> its not working as expected.
  • Create separate cache for ansible-collections - Implemented it with artifacts
  • Install dependencies in one job and upload to artifacts then reuse in other jobs. - Implemented it here https://github.com/aristanetworks/avd/actions/runs/12631183731
  • Create container image with all dependencies and reuse the image in other jobs. - CI: Implement container action Shivani-gslab/avd#9 CI: container changes Shivani-gslab/avd#10

Related Issue(s)

Fixes #

Component(s) name

arista.avd.<role-name>

Proposed changes

How to test

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

Copy link

github-actions bot commented Dec 3, 2024

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4778
# Activate the virtual environment
source test-avd-pr-4778/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/Shivani-gslab/avd.git@github_cache_tests#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/Shivani-gslab/avd.git#/ansible_collections/arista/avd/,github_cache_tests --force
# Optional: Install AVD examples
cd test-avd-pr-4778
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added the type: code quality CI and development toolset label Dec 3, 2024
@Shivani-gslab Shivani-gslab force-pushed the github_cache_tests branch 4 times, most recently from 577ca00 to 4adc10e Compare December 6, 2024 06:55
@github-actions github-actions bot added the state: conflict PR with conflict label Dec 9, 2024
Copy link

github-actions bot commented Dec 9, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the state: conflict PR with conflict label Dec 10, 2024
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot added the state: conflict PR with conflict label Dec 12, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the state: conflict PR with conflict label Dec 20, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the state: conflict PR with conflict label Dec 23, 2024
@Shivani-gslab Shivani-gslab force-pushed the github_cache_tests branch 2 times, most recently from 3dbeea2 to 7cb6f37 Compare December 23, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: code quality CI and development toolset
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant