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_VER: 3.1
ASTYLE_REPO: https://svn.code.sf.net/p/astyle/code/tags ASTYLE_REPO: https://svn.code.sf.net/p/astyle/code/tags
steps: steps:
# This is currently the only way to get a version into # Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
# the cache tag name - see https://github.com/actions/cache/issues/543 # see https://github.com/actions/cache/issues/543
- run: | - name: Get operating system name and version.
echo "OS_VERSION=`lsb_release -sr`" >> $GITHUB_ENV id: os
run: echo "::set-output name=image::$ImageOS"
shell: bash
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Cache astyle - name: Cache astyle
uses: actions/cache@v2 uses: actions/cache@v2
@ -172,7 +174,7 @@ jobs:
cache-name: cache-astyle cache-name: cache-astyle
with: with:
path: ~/astyle.local 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: sudo scripts/install_astyle_dependencies_with_apt.sh
- run: scripts/install_astyle.sh $ASTYLE_REPO $ASTYLE_VER - run: scripts/install_astyle.sh $ASTYLE_REPO $ASTYLE_VER
- name: Format code with astyle - name: Format code with astyle