[2/2] ci: update to new API for step outputs in GHA

Message ID 20221012162942.2965188-3-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series GitHub Actions configuration fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

David Marchand Oct. 12, 2022, 4:29 p.m. UTC
  GitHub actions deprecated use of set-output, replaced with
GITHUB_OUTPUT.

Note: we still have some warnings, as of today, because of
actions/cache@v3 which did not migrate yet.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .github/workflows/build.yml | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)
  

Comments

David Marchand Oct. 12, 2022, 4:53 p.m. UTC | #1
On Wed, Oct 12, 2022 at 6:30 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> GitHub actions deprecated use of set-output, replaced with
> GITHUB_OUTPUT.
>
> Note: we still have some warnings, as of today, because of
> actions/cache@v3 which did not migrate yet.

For the record, the changes in actions/cache@v3 are pushed in its main
branch, but are not released yet.
https://github.com/actions/cache/commit/b9c8bfe4426d
  
David Marchand Oct. 17, 2022, 2:01 p.m. UTC | #2
On Wed, Oct 12, 2022 at 6:53 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Wed, Oct 12, 2022 at 6:30 PM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > GitHub actions deprecated use of set-output, replaced with
> > GITHUB_OUTPUT.

It is worth mentionning the deprecation announce:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

> >
> > Note: we still have some warnings, as of today, because of
> > actions/cache@v3 which did not migrate yet.
>
> For the record, the changes in actions/cache@v3 are pushed in its main
> branch, but are not released yet.
> https://github.com/actions/cache/commit/b9c8bfe4426d

The fixes have been released under v3.0.11.

So with this series applied, there is no warning remaining, for now.
  

Patch

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 187fdef306..b32758ff6f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -86,12 +86,9 @@  jobs:
     - name: Generate cache keys
       id: get_ref_keys
       run: |
-        echo -n '::set-output name=ccache::'
-        echo 'ccache-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-'$(date -u +%Y-w%W)
-        echo -n '::set-output name=libabigail::'
-        echo 'libabigail-${{ matrix.config.os }}'
-        echo -n '::set-output name=abi::'
-        echo 'abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.LIBABIGAIL_VERSION }}-${{ env.REF_GIT_TAG }}'
+        echo 'ccache=ccache-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-'$(date -u +%Y-w%W) >> $GITHUB_OUTPUT
+        echo 'libabigail=libabigail-${{ matrix.config.os }}' >> $GITHUB_OUTPUT
+        echo 'abi=abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.LIBABIGAIL_VERSION }}-${{ env.REF_GIT_TAG }}' >> $GITHUB_OUTPUT
     - name: Retrieve ccache cache
       uses: actions/cache@v3
       with:
@@ -177,8 +174,7 @@  jobs:
     - name: Generate various keys
       id: get_keys
       run: |
-        echo -n '::set-output name=image::'
-        echo 'image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d)
+        echo 'image=image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d) >> $GITHUB_OUTPUT
     - name: Retrieve image cache
       id: image_cache
       uses: actions/cache@v3
@@ -239,12 +235,9 @@  jobs:
     - name: Generate various keys
       id: get_keys
       run: |
-        echo -n '::set-output name=ccache::'
-        echo 'ccache-${{ matrix.config.image }}-${{ matrix.config.compiler }}-'$(date -u +%Y-w%W)
-        echo -n '::set-output name=image::'
-        echo 'image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d)
-        echo -n '::set-output name=logs::'
-        echo 'meson-logs-${{ join(matrix.config.*, '-') }}' | tr -d ':'
+        echo 'ccache=ccache-${{ matrix.config.image }}-${{ matrix.config.compiler }}-'$(date -u +%Y-w%W) >> $GITHUB_OUTPUT
+        echo 'image=image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d) >> $GITHUB_OUTPUT
+        echo 'logs=meson-logs-${{ join(matrix.config.*, '-') }}' | tr -d ':' >> $GITHUB_OUTPUT
     - name: Retrieve image cache
       id: image_cache
       uses: actions/cache@v3