mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-15 01:34:02 +02:00
Fix Python caching in the GitHub Actions workflows
For the Python-based workflows we were already using `pip` caching [1], but sadly this isn't fully functional at the moment because the caching functionality uses `requirements.txt` to determine when to create or invalidate the cache. However, we have two different `pip` install commands but only a `requirements.txt` for one of them (the Fluent linter), which means that the other job (the font tests) will not populate the cache with its dependencies. This can be seen by opening any font tests or Fluent linting build and noticing that they report the exact same cache key even though their dependencies are different. In the installation step the dependencies are reported as "Downloading [package].whl" instead of the expected "Using cached [package].whl". This commit fixes the issue by explicitly defining a `requirements.txt` file for both jobs and pointing the caching functionality to the specific file paths to make sure that unique caches with the correct package data are used. While we're here we also align the syntax and step titles in the files for consistency. [1] https://github.com/actions/setup-python?tab=readme-ov-file#caching-packages-dependencies
This commit is contained in:
parent
a3b19875ec
commit
8d4151cfbb
1
.github/font_tests_requirements.txt
vendored
Normal file
1
.github/font_tests_requirements.txt
vendored
Normal file
@ -0,0 +1 @@
|
||||
fonttools==4.*
|
||||
9
.github/workflows/fluent_linter.yml
vendored
9
.github/workflows/fluent_linter.yml
vendored
@ -34,11 +34,10 @@ jobs:
|
||||
with:
|
||||
python-version: '3.14'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: '.github/fluent_linter_requirements.txt'
|
||||
|
||||
- name: Install Fluent dependencies
|
||||
run: |
|
||||
pip install -r .github/requirements.txt
|
||||
- name: Install requirements
|
||||
run: pip install -r .github/fluent_linter_requirements.txt
|
||||
|
||||
- name: Lint Fluent reference files
|
||||
run: |
|
||||
moz-fluent-lint ./l10n/en-US --config .github/fluent_linter_config.yml
|
||||
run: moz-fluent-lint ./l10n/en-US --config .github/fluent_linter_config.yml
|
||||
|
||||
5
.github/workflows/font_tests.yml
vendored
5
.github/workflows/font_tests.yml
vendored
@ -56,9 +56,10 @@ jobs:
|
||||
with:
|
||||
python-version: '3.14'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: '.github/font_tests_requirements.txt'
|
||||
|
||||
- name: Install Fonttools
|
||||
run: pip install fonttools
|
||||
- name: Install requirements
|
||||
run: pip install -r .github/font_tests_requirements.txt
|
||||
|
||||
- name: Run font tests
|
||||
run: npx gulp fonttest --headless
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user