Skip to content

Commit

Permalink
add workaround for cache sometimes not being restored correctly on ma…
Browse files Browse the repository at this point in the history
…cos, move java setup to run later
  • Loading branch information
purificant committed Dec 23, 2023
1 parent bc32be0 commit e3dee4d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,18 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up JDK 16
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '16'
if: runner.os == 'Linux'

- name: Cache dependencies
- name: Restore cached dependencies
uses: actions/cache@v3
id: restore-cache
with:
path: ${{ env.pythonLocation }}
key: python-dependencies-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements-ci.txt') }}-${{ env.pythonLocation }}

- name: Install dependencies on cache miss
- name: Install dependencies
run: |
pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir --upgrade --requirement requirements-ci.txt
if: steps.restore-cache.outputs.cache-hit != 'true'
pip install --upgrade pip
pip install --upgrade --requirement requirements-ci.txt
#if: steps.restore-cache.outputs.cache-hit != 'true' # disabled due to a persistent issue with restoring cache on macos runner

- name: Use cached nltk data
uses: actions/cache@v3
Expand All @@ -126,6 +119,13 @@ jobs:
key: third_${{ hashFiles('tools/github_actions/third-party.sh') }}_${{ secrets.CACHE_VERSION }}
if: runner.os == 'Linux'

- name: Set up JDK 16
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '16'
if: runner.os == 'Linux'

- name: Run pytest
shell: bash
run: |
Expand Down

0 comments on commit e3dee4d

Please sign in to comment.