Skip to content

Commit

Permalink
Use eyal0/cache action that can force/disable update as needed (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyal0 committed Jan 4, 2021
1 parent f69ab0a commit bf03b3d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,18 @@ jobs:
id: sanitize-key
run: echo "::set-output name=key::$(echo '${{ matrix.os }}_${{ matrix.boost }}_${{ matrix.compiler }}_${{ matrix.geos }}' | sed 's/+/plus/g')"
- name: Cache .local
uses: actions/cache@v2.1.3
uses: eyal0/cache@main
with:
path: ~/.local
key: ${{ steps.sanitize-key.outputs.key }}
update-env-variable: "UPDATE_CACHE"
- name: Build and install boost
if: matrix.os == 'ubuntu'
env:
BOOST: ${{ matrix.boost }}_0
run: |
if [ ! -d "${HOME}/.local/include/boost" ]; then
echo "UPDATE_CACHE=true" >> $GITHUB_ENV
pushd ~
for i in {1..5}; do
wget -q -T20 -t1 -O "boost_${BOOST}.tar.bz2" "https://github.com/pcb2gcode/pcb2gcode/releases/download/v2.0.0/boost_${BOOST}.tar.bz2" && break;
Expand All @@ -117,6 +119,7 @@ jobs:
GEOS: ${{ matrix.geos }}
run: |
if [ ! -d "${HOME}/.local/include/geos" ]; then
echo "UPDATE_CACHE=true" >> $GITHUB_ENV
pushd ~
for i in {1..5}; do
wget -q -T20 -t1 -O "geos-${GEOS}.tar.bz2" "http://download.osgeo.org/geos/geos-${GEOS}.tar.bz2" && break;
Expand Down Expand Up @@ -149,6 +152,7 @@ jobs:
- name: Install gerbv
run: |
if ! gerbv --version; then
echo "UPDATE_CACHE=true" >> $GITHUB_ENV
pushd ~
git clone --depth=1 https://github.com/eyal0/gerbv.git
pushd gerbv
Expand All @@ -163,6 +167,7 @@ jobs:
if: matrix.os == 'ubuntu'
run: |
if ! valgrind --version; then
echo "UPDATE_CACHE=true" >> $GITHUB_ENV
pushd ~
git clone --depth=1 git://sourceware.org/git/valgrind.git
pushd valgrind
Expand All @@ -176,6 +181,7 @@ jobs:
- name: Install parallel
run: |
if ! parallel --version; then
echo "UPDATE_CACHE=true" >> $GITHUB_ENV
pushd ~
for i in {1..5}; do
wget -q -T5 -t1 -O "parallel-latest.tar.bz2" 'https://ftpmirror.gnu.org/parallel/parallel-latest.tar.bz2' && break;
Expand Down Expand Up @@ -317,16 +323,18 @@ jobs:
echo "::set-output name=key::$(echo '${{ matrix.os }}_${{ matrix.boost }}_${{ matrix.compiler }}_${{ matrix.geos }}' | sed 's/+/plus/g')"
echo "::set-output name=path::$(cygpath -w ${{ matrix.local_install_path }})"
- name: Cache local install path
uses: actions/cache@v2.1.3
uses: eyal0/cache@main
with:
path: ${{ steps.sanitize-key.outputs.path }}
key: ${{ steps.sanitize-key.outputs.key }}
update-env-variable: "UPDATE_CACHE"
- name: Build and install geos
if: matrix.geos != 'none'
env:
GEOS: ${{ matrix.geos }}
run: |
if [ ! -d "${LOCAL_INSTALL_PATH}/include/geos" ]; then
echo "UPDATE_CACHE=true" >> $GITHUB_ENV
pushd ~
for i in {1..5}; do
wget -q -T20 -t1 -O "geos-${GEOS}.tar.bz2" "http://download.osgeo.org/geos/geos-${GEOS}.tar.bz2" && break;
Expand All @@ -350,6 +358,7 @@ jobs:
- name: Install gerbv
run: |
if ! gerbv --version; then
echo "UPDATE_CACHE=true" >> $GITHUB_ENV
pushd ~
git clone --depth=1 https://github.com/eyal0/gerbv.git
pushd gerbv
Expand All @@ -363,6 +372,7 @@ jobs:
- name: Install parallel
run: |
if ! parallel --version; then
echo "UPDATE_CACHE=true" >> $GITHUB_ENV
pushd ~
for i in {1..5}; do
wget -q -T5 -t1 -O "parallel-latest.tar.bz2" "http://ftpmirror.gnu.org/parallel/parallel-latest.tar.bz2" && break;
Expand Down

0 comments on commit bf03b3d

Please sign in to comment.