github actions: use canonical way to get ImageOS for astyle

This commit is contained in:
matt335672 2022-05-27 11:48:16 +01:00
parent 690d9e88d3
commit be2b778bae

View File

@ -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