Skip to content

Conversation

@bkeryan
Copy link
Collaborator

@bkeryan bkeryan commented Apr 14, 2025

  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

Cache virtualenvs used in GitHub Actions workflows.

Why should this Pull Request be merged?

Speed up PR/CI workflows, reduce GitHub/PyPI resource usage.

What testing has been done?

TBD

@github-actions
Copy link
Contributor

github-actions bot commented Apr 14, 2025

Test Results

    34 files  ±0      34 suites  ±0   58m 9s ⏱️ + 1m 51s
 2 396 tests ±0   2 042 ✅ ±0    354 💤 ±0  0 ❌ ±0 
43 102 runs  ±0  36 850 ✅ ±0  6 252 💤 ±0  0 ❌ ±0 

Results for commit 4b5aabb. ± Comparison against base commit a5cc5bf.

♻️ This comment has been updated with latest results.

@bkeryan
Copy link
Collaborator Author

bkeryan commented Apr 14, 2025

1st run: https://github.com/ni/nidaqmx-python/actions/runs/14451634791/job/40525509094?pr=702

Build - 1m 4s
Run unit tests (ubuntu-latest, 3.9) - 49s
Run unit tests (windows-latest, 3.9) - 1m 22s
Generate docs - 52s
Run system tests (win-10-py64) - 35m 13s

@bkeryan
Copy link
Collaborator Author

bkeryan commented Apr 14, 2025

Caching on the self-hosted runner isn't working yet because it doesn't have zstandard installed:

1s
Post job cleanup.
"C:\Program Files\Git\usr\bin\tar.exe" --posix -cf cache.tgz --exclude cache.tgz -P -C C:/ar/_work/nidaqmx-python/nidaqmx-python --files-from manifest.txt --force-local -z
/bin/sh: line [1](https://github.com/ni/nidaqmx-python/actions/runs/14451634791/job/40525716518?pr=702#step:17:1): gzip: command not found
/usr/bin/tar: cache.tgz: Cannot write: Broken pipe
/usr/bin/tar: Child returned status 1[2](https://github.com/ni/nidaqmx-python/actions/runs/14451634791/job/40525716518?pr=702#step:17:2)7
/usr/bin/tar: Error is not recoverable: exiting now
Warning: Failed to save: "C:\Program failed with error: The process 'C:\Program Files\Git\usr\bin\tar.exe' failed with exit code 2

@bkeryan
Copy link
Collaborator Author

bkeryan commented Apr 15, 2025

1st run: https://github.com/ni/nidaqmx-python/actions/runs/14451634791/job/40525509094?pr=702

Build - 1m 4s
Run unit tests (ubuntu-latest, 3.9) - 49s
Run unit tests (windows-latest, 3.9) - 1m 22s
Generate docs - 52s
Run system tests (win-10-py64) - 35m 13s

3rd run:

Build - 1m 4s (cached)
Run unit tests (ubuntu-latest, 3.9) - 55s (cached)
Run unit tests (windows-latest, 3.9) - 1m 17s (cached)
Generate docs - 40s (cached)
Run system tests (win-10-py64) - 38m 47s (not cached, uploaded cache)

4th run:

Build - 1m 10s (cached)
Run unit tests (ubuntu-latest, 3.9) - 51s (cached)
Run unit tests (windows-latest, 3.9) - 1m 21s (cached)
Generate docs - 52s (cached)
Run system tests (win-10-py64) - 37m 4s (cached)

For the "fast" workflows like "Build" and "Run unit tests", there is one more venv we're not caching yet: the one in which Poetry is installed. The setup-poetry action is still downloading the Poetry install script and Poetry packages every time.

For the "slow" workflows ("Run system tests"), the caching is working but it takes ~4 min to upload or download the cache file, so it's not really a win (with respect to overall time) at this point. However, at least it should be accessing PyPI less.

@bkeryan bkeryan merged commit 367b5d0 into master Apr 28, 2025
17 checks passed
@bkeryan bkeryan deleted the users/bkeryan/github-action-caching branch April 28, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants