From c9e2c239fd8f62404554f8d73eb37a7fdbec286c Mon Sep 17 00:00:00 2001 From: Ronan Keryell Date: Thu, 5 Oct 2023 08:43:36 -0700 Subject: [PATCH 1/4] Update GitHub actions to latest Node version The current ones are deprecated because running on unsupported Node 12. --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c8d23b56..4f860e19 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,4 +1,4 @@ -# Copyright 2021 The Khronos Group, Inc. +# Copyright 2021-2023 The Khronos Group, Inc. # SPDX-License-Identifier: Apache-2.0 # CI to build asciidoctor spec targets, on push or manually @@ -30,7 +30,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Unfortunately, asciidoctor-pdf gets pathname-specific errors # building under the usual $GITHUB_WORKSPACE (/__w). As a workaround, @@ -41,7 +41,7 @@ jobs: cd adoc make OUTDIR=/tmp/out QUIET= html pdf - name: Archive generated files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: spec-outputs path: | From 392f76c40f848abf0e6c6e159a498c396969daef Mon Sep 17 00:00:00 2001 From: Ronan Keryell Date: Fri, 6 Oct 2023 14:38:43 -0700 Subject: [PATCH 2/4] Add verbose information in CI output to help further developments --- .github/workflows/CI.yml | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4f860e19..ca8362c2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,6 +29,65 @@ jobs: container: khronosgroup/docker-images:asciidoctor-spec steps: + - name: Display environment variables + run: env + + - name: User and group ids + run: id -a + + - name: Execution context information + # Display a lot of information to help further development + # https://docs.github.com/en/actions/learn-github-actions/variables + # https://docs.github.com/en/enterprise-cloud@latest/actions/learn-github-actions/contexts + # The problem is that echo-ing directly "${{ toJSON(github) }}" + # in the shell is not escaped and for example '&' breaks + # things or can lead to server-side script injection. :-( + # So, use environment setting and display the environment + # variable in the shell between "" to avoid unsafe + # interpretation. + env: + execution_context_var_github: ${{ toJSON(github) }} + execution_context_var_env: ${{ toJSON(env) }} + execution_context_var_vars: ${{ toJSON(vars) }} + execution_context_var_job: ${{ toJSON(job) }} + execution_context_var_steps: ${{ toJSON(steps) }} + execution_context_var_runner: ${{ toJSON(runner) }} + execution_context_var_strategy: ${{ toJSON(strategy) }} + execution_context_var_matrix: ${{ toJSON(matrix) }} + execution_context_var_needs: ${{ toJSON(needs) }} + execution_context_var_inputs: ${{ toJSON(inputs) }} + run: | + echo "::group::github context" + echo "$execution_context_var_github" + echo "::endgroup::" + echo "::group::env context" + echo "$execution_context_var_env" + echo "::endgroup::" + echo "::group::vars context" + echo "$execution_context_var_vars" + echo "::endgroup::" + echo "::group::job context" + echo "$execution_context_var_job" + echo "::endgroup::" + echo "::group::steps context" + echo "$execution_context_var_steps" + echo "::endgroup::" + echo "::group::runner context" + echo "$execution_context_var_runner" + echo "::endgroup::" + echo "::group::strategy context" + echo "$execution_context_var_strategy" + echo "::endgroup::" + echo "::group::matrix context" + echo "$execution_context_var_matrix" + echo "::endgroup::" + echo "::group::needs context" + echo "$execution_context_var_needs" + echo "::endgroup::" + echo "::group::inputs context" + echo "$execution_context_var_inputs" + echo "::endgroup::" + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 From 67a6a7673a7dbf702ba928589db2770f5b56dd46 Mon Sep 17 00:00:00 2001 From: Ronan Keryell Date: Fri, 6 Oct 2023 14:51:40 -0700 Subject: [PATCH 3/4] Add optional tmate launch for debugging Allow an incoming ssh connection after the spec compilation for inspection in case in fails. --- .github/workflows/CI.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ca8362c2..28b5e890 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -17,8 +17,22 @@ on: # Also build when some pull requests are created pull_request: - # Allows you to run this workflow manually from the Actions tab + # Allows you to run this workflow manually from the Actions tab by + # selecting CI and then "Run workflow" menu on the right branch + # and clicking on "launch_tmate_terminal_for_debug". + # Unfortunately this works only for the default branch. + # So you can either + # - change the default branch of the PR on the GitHub repository owning the PR + # and launching in Actions tab; + # - or edit directly the step below which runs tmate and push to the + # PR, ignoring the manual workflow launch. workflow_dispatch: + inputs: + launch_tmate_terminal_for_debug: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false jobs: build: @@ -99,6 +113,17 @@ jobs: run: | cd adoc make OUTDIR=/tmp/out QUIET= html pdf + + # Launch an ssh session via a proxy server if there is a need + # for debug. This seems to live for 35 min max + # https://github.com/mxschmitt/action-tmate + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + # To run this, launch it manually on the default branch and + # click on "launch_tmate_terminal_for_debug" + if: github.event_name == 'workflow_dispatch' + && inputs.launch_tmate_terminal_for_debug + - name: Archive generated files uses: actions/upload-artifact@v3 with: From 291271c1c288114e6c7de8ae07a40b0635e58a1c Mon Sep 17 00:00:00 2001 From: Ronan Keryell Date: Wed, 27 Mar 2024 10:26:29 -0700 Subject: [PATCH 4/4] Update CI actions/upload-artifact to v4 --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 28b5e890..2eb06a9a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 The Khronos Group, Inc. +# Copyright 2021-2024 The Khronos Group, Inc. # SPDX-License-Identifier: Apache-2.0 # CI to build asciidoctor spec targets, on push or manually @@ -125,7 +125,7 @@ jobs: && inputs.launch_tmate_terminal_for_debug - name: Archive generated files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: spec-outputs path: |