From 7be81ab6d6028b2970315f058880872d400c2b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Wed, 27 Nov 2024 10:23:14 +0100 Subject: [PATCH] caching the compiler --- .github/workflows/ccpp.yml | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index a143087684f..4f551a958b7 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -296,10 +296,29 @@ jobs: dejagnu; # install Rust directly using rustup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0; - curl "https://s3.amazonaws.com/compiler-explorer/opt/gcc-5.4.0.tar.xz" -o /tmp/gcc.tar.xz; - sudo mkdir -p /usr/local/; - cd /usr/local; - sudo tar xvf /tmp/gcc.tar.xz + + - name: Restore cached gcc-5.4 + id: restore-gcc5.4 + uses: actions/cache/restore@v4 + with: + key: ce-tar-gcc-5.4 + path: /usr/local/gcc-5.4 + + - name: Download and install gcc5.4 + if: ${{ steps.restore-gcc5.4.outputs.cache-hit != 'true' }} + run: | + curl "https://s3.amazonaws.com/compiler-explorer/opt/gcc-5.4.0.tar.xz" -o /tmp/gcc.tar.xz; + sudo mkdir -p /usr/local/; + cd /usr/local; + sudo tar xvf /tmp/gcc.tar.xz + + - name: Store gcc-5.4 to cache + id: cache-gcc5.4 + if: always() && steps.restore-gcc5.4.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + key: ${{ steps.restore-gcc5.4.outputs.cache-primary-key }} + path: /usr/local/gcc-5.4 - name: Make Source Read-Only run: chmod -R a-w ./* @@ -308,8 +327,10 @@ jobs: run: | mkdir -p gccrs-build; cd gccrs-build; - PATH=/usr/local/gcc-5.4.0/bin:$PATH gcc --version; - PATH=/usr/local/gcc-5.4.0/bin:$PATH type gcc; + + # Add cargo to our path quickly + . "$HOME/.cargo/env"; + PATH=/usr/local/gcc-5.4.0/bin:$PATH \ ../configure \ --enable-languages=rust \