From be2b778bae1f77c7a2172e3404529080e6c9655e Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Fri, 27 May 2022 11:48:16 +0100 Subject: [PATCH] github actions: use canonical way to get ImageOS for astyle --- .github/workflows/build.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21caacac..81917ba1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -161,10 +161,12 @@ jobs: ASTYLE_VER: 3.1 ASTYLE_REPO: https://svn.code.sf.net/p/astyle/code/tags steps: - # This is currently the only way to get a version into - # the cache tag name - see https://github.com/actions/cache/issues/543 - - run: | - echo "OS_VERSION=`lsb_release -sr`" >> $GITHUB_ENV + # Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20') + # see https://github.com/actions/cache/issues/543 + - name: Get operating system name and version. + id: os + run: echo "::set-output name=image::$ImageOS" + shell: bash - uses: actions/checkout@v2 - name: Cache astyle uses: actions/cache@v2 @@ -172,7 +174,7 @@ jobs: cache-name: cache-astyle with: path: ~/astyle.local - key: ${{ runner.os }}-${{ env.OS_VERSION }}-build-${{ env.cache-name }}-${{ env.ASTYLE_VER }} + key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.ASTYLE_VER }} - run: sudo scripts/install_astyle_dependencies_with_apt.sh - run: scripts/install_astyle.sh $ASTYLE_REPO $ASTYLE_VER - name: Format code with astyle