From 69b73657b61af3478e3225c4146760d041ff883b Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 18 Oct 2023 14:56:08 -0700 Subject: [PATCH] Simplify expression in container conditional steps of build workflow The "Arduino IDE" GitHub Actions workflow uses a Docker container for the build job of certain target, while running others directly in the runner environment. Due to differences between these two environments, some steps must run only when a container is used by the job, and others only when the job is running in the runner environment. This is done by a conditional on the job matrix data regarding the container. The container value is set to null for the jobs that run in the runner environment, while containing a full container configuration mapping for the jobs that run in a container. Previously the conditional unnecessarily used the value of the image key of the container object specifically. The comparison can be done against the container value itself. Doing this will make it a little easier to understand the workflow code, since the conditional more clearly reflects the matrix (where `container` is set to `null` instead of `container.image`). --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 206b1879..c499f958 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -284,16 +284,16 @@ jobs: steps: - name: Checkout - if: fromJSON(matrix.config.container).image == null + if: fromJSON(matrix.config.container) == null uses: actions/checkout@v4 - name: Checkout # actions/checkout@v4 has dependency on a higher version of glibc than available in the Linux container. - if: fromJSON(matrix.config.container).image != null + if: fromJSON(matrix.config.container) != null uses: actions/checkout@v3 - name: Install Node.js - if: fromJSON(matrix.config.container).image == null + if: fromJSON(matrix.config.container) == null uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} @@ -301,7 +301,7 @@ jobs: cache: 'yarn' - name: Install Python 3.x - if: fromJSON(matrix.config.container).image == null + if: fromJSON(matrix.config.container) == null uses: actions/setup-python@v4 with: python-version: '3.11.x'