Skip to content

Commit

Permalink
workflows: _really_ fix Boost caching?..
Browse files Browse the repository at this point in the history
actions/cache@v2 doesn't work on windows-2016 images, since those
contain the GNU tar, which cannot work with \ as path separator.  This
was fixed in package @actions/cache v1.0.5, which is used by action
actions/[email protected] [1][2].

In addition, it simply couldn't find tar.exe on those images thanks to
my action cleanup-path, which removed the corresponding directory (I
think it was Git's bin/) from PATH.  It worked for windows-2019 images
thanks to them containing tar.exe in System32.  Solved by turning
cleanup-path into a JavaScript action with a "post" step, which restores
the original PATH value.

[1]: actions/runner-images#480
[2]: actions/toolkit#632
  • Loading branch information
egor-tensin committed Mar 14, 2021
1 parent 8726fce commit eca875b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
python-version: '3.x'

- name: Cache Boost
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: boost_*.tar.gz
key: ${{ runner.os }}-boost-1.72.0
key: boost-1.72.0

- name: Build Boost
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/boost_clang_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
uses: actions/checkout@v2

- name: Cache Boost
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: '${{ runner.workspace }}/boost/boost_*.tar.gz'
key: '${{ runner.os }}-boost-${{ matrix.boost-version }}'
key: 'boost-${{ matrix.boost-version }}'

- name: Clean up PATH
uses: egor-tensin/cleanup-path@v1
uses: egor-tensin/cleanup-path@v2
if: runner.os == 'Windows'

- name: Set common variables
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/boost_toolsets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ jobs:
uses: actions/checkout@v2

- name: Cache Boost
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: '${{ runner.workspace }}/boost/boost_*.tar.gz'
key: '${{ runner.os }}-boost-${{ matrix.boost-version }}'
key: 'boost-${{ matrix.boost-version }}'

- name: Clean up PATH
uses: egor-tensin/cleanup-path@v1
uses: egor-tensin/cleanup-path@v2
if: runner.os == 'Windows'

- name: Set common variables
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
python-version: '3.x'

- name: Cache Boost
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: C:\projects\boost_*.tar.gz
key: '${{ runner.os }}-boost-${{ env.boost_version }}'
key: 'boost-${{ env.boost_version }}'

- name: Create C:\projects
run: mkdir C:\projects
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
python-version: '3.x'

- name: Cache Boost
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: '${{ runner.workspace }}/boost_*.tar.gz'
key: '${{ runner.os }}-boost-${{ env.boost_version }}'
key: 'boost-${{ env.boost_version }}'

- name: Build Boost
run: python -m project.ci.boost -- --with-filesystem
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
python-version: '3.x'

- name: Cache Boost
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: '${{ env.HOME }}/boost_*.tar.gz'
key: '${{ runner.os }}-boost-${{ env.boost_version }}'
key: 'boost-${{ env.boost_version }}'

- name: Build Boost
run: python -m project.ci.travis.boost -- --with-filesystem
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cygwin_static_libstdc++.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/checkout@v2

- name: Clean up PATH
uses: egor-tensin/cleanup-path@v1
uses: egor-tensin/cleanup-path@v2
if: runner.os == 'Windows'

- name: Set common variables
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example_toolsets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
uses: actions/checkout@v2

- name: Clean up PATH
uses: egor-tensin/cleanup-path@v1
uses: egor-tensin/cleanup-path@v2
if: runner.os == 'Windows'

- name: Set common variables
Expand Down

0 comments on commit eca875b

Please sign in to comment.