From 18e8592cf40231b426c48c495b4d09b67b4f0b01 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Wed, 13 Dec 2023 17:24:10 -0700 Subject: [PATCH 01/16] chore: add run_bazel_test action --- .github/actions/run_bazel_test/action.yaml | 18 +++++++ .github/workflows/workflow.yaml | 56 +++++++++++++--------- 2 files changed, 52 insertions(+), 22 deletions(-) create mode 100644 .github/actions/run_bazel_test/action.yaml diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml new file mode 100644 index 0000000..5481a39 --- /dev/null +++ b/.github/actions/run_bazel_test/action.yaml @@ -0,0 +1,18 @@ +name: Execute Bazel test +description: Handles platform-specific settings. + +inputs: + working-directory: + type: string + +runs: + using: composite + env: + BAZEL_SH: ${{ runner.os == 'Windows' && 'C:\msys64\usr\bin\bash.exe' || '' }} + RBT_WORKING_DIR: ${{ inputs.working-directory }} + steps: + - shell: bash + run: | + [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" + bazel test "//..." + diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 49d6556..222ba0b 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -55,34 +55,46 @@ jobs: if: ${{ matrix.bazel_mode == 'module' }} with: content: build --experimental_enable_bzlmod - - name: Run tests (bzlmod) - if: matrix.bazel_mode == 'module' - working-directory: ./tests + - name: Configure the Bazel version run: | echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc + echo "USE_BAZEL_VERSION=${{ matrix.version }}" > tests/.bazeliskrc + - name: Run Bazel test at root + if: ${{ matrix.bazel_mode == 'workspace' }} + uses: ./.github/actions/run_bazel_test + - name: Run Bazel test under tests directory + uses: ./.github/actions/run_bazel_test + with: + working-directory: tests - if [[ ${{ runner.os }} == Windows ]]; then - # On Windows `//...` expands to `/...`. - BAZEL_SH='C:\msys64\usr\bin\bash.exe' bazel test ///... - else - bazel test //... - fi + # - name: Run tests (bzlmod) + # if: matrix.bazel_mode == 'module' + # working-directory: ./tests + # run: | + # echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc - - name: Run tests (workspace) - if: matrix.bazel_mode == 'workspace' - run: | - echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc - echo "USE_BAZEL_VERSION=${{ matrix.version }}" > tests/.bazeliskrc + # if [[ ${{ runner.os }} == Windows ]]; then + # # On Windows `//...` expands to `/...`. + # BAZEL_SH='C:\msys64\usr\bin\bash.exe' bazel test ///... + # else + # bazel test //... + # fi + + # - name: Run tests (workspace) + # if: matrix.bazel_mode == 'workspace' + # run: | + # echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc + # echo "USE_BAZEL_VERSION=${{ matrix.version }}" > tests/.bazeliskrc - if [[ ${{ runner.os }} == Windows ]]; then - # Because of the docstring quote issue on Windows we skip the stardoc test on the main workspace. - # On Windows `//...` expands to `/...`. - cd tests && BAZEL_SH='C:\msys64\usr\bin\bash.exe' bazel test ///... - else - bazel test //... + # if [[ ${{ runner.os }} == Windows ]]; then + # # Because of the docstring quote issue on Windows we skip the stardoc test on the main workspace. + # # On Windows `//...` expands to `/...`. + # cd tests && BAZEL_SH='C:\msys64\usr\bin\bash.exe' bazel test ///... + # else + # bazel test //... - cd tests && bazel test //... - fi + # cd tests && bazel test //... + # fi all_ci_tests: runs-on: ubuntu-latest From 915dab58099ea44dee150268b9f673868d18bba9 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Wed, 13 Dec 2023 17:51:40 -0700 Subject: [PATCH 02/16] Use matrix.os for if. --- .github/workflows/workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 222ba0b..44f82e6 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -46,7 +46,7 @@ jobs: - name: Disable stardoc # Windows: Stardoc complains about docstring quote indentation on Windows. # bzlmod: Stardoc does not work with bzlmod. - if: ${{ runner.os == 'Windows' || matrix.bazel_mode == 'module' }} + if: ${{ matrix.os == windows-2019 || matrix.bazel_mode == 'module' }} uses: tweag/write-bazelrc@v0 with: content: build --config=no-stardoc From b1890894f9fa680784d00693103cba6c6864195f Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Wed, 13 Dec 2023 17:52:57 -0700 Subject: [PATCH 03/16] Quote the os value --- .github/workflows/workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 44f82e6..0b838d7 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -46,7 +46,7 @@ jobs: - name: Disable stardoc # Windows: Stardoc complains about docstring quote indentation on Windows. # bzlmod: Stardoc does not work with bzlmod. - if: ${{ matrix.os == windows-2019 || matrix.bazel_mode == 'module' }} + if: ${{ matrix.os == 'windows-2019' || matrix.bazel_mode == 'module' }} uses: tweag/write-bazelrc@v0 with: content: build --config=no-stardoc From 2f542cc1e309837442e078cb60c158cb2a56e21e Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Wed, 13 Dec 2023 17:59:15 -0700 Subject: [PATCH 04/16] Pass os to the action. --- .github/actions/run_bazel_test/action.yaml | 4 +++- .github/workflows/workflow.yaml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml index 5481a39..a691262 100644 --- a/.github/actions/run_bazel_test/action.yaml +++ b/.github/actions/run_bazel_test/action.yaml @@ -4,11 +4,13 @@ description: Handles platform-specific settings. inputs: working-directory: type: string + os: + type: string runs: using: composite env: - BAZEL_SH: ${{ runner.os == 'Windows' && 'C:\msys64\usr\bin\bash.exe' || '' }} + BAZEL_SH: ${{ startswith(inputs.os, 'windows-') && 'C:\msys64\usr\bin\bash.exe' || '' }} RBT_WORKING_DIR: ${{ inputs.working-directory }} steps: - shell: bash diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 0b838d7..26071ff 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -62,10 +62,13 @@ jobs: - name: Run Bazel test at root if: ${{ matrix.bazel_mode == 'workspace' }} uses: ./.github/actions/run_bazel_test + with: + os: ${{ matrix.os }} - name: Run Bazel test under tests directory uses: ./.github/actions/run_bazel_test with: working-directory: tests + os: ${{ matrix.os }} # - name: Run tests (bzlmod) # if: matrix.bazel_mode == 'module' From a5830d4058f32238e48cca2c43286a06eeceeea5 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Wed, 13 Dec 2023 18:01:56 -0700 Subject: [PATCH 05/16] Fix action --- .github/actions/run_bazel_test/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml index a691262..c787c56 100644 --- a/.github/actions/run_bazel_test/action.yaml +++ b/.github/actions/run_bazel_test/action.yaml @@ -9,11 +9,11 @@ inputs: runs: using: composite - env: - BAZEL_SH: ${{ startswith(inputs.os, 'windows-') && 'C:\msys64\usr\bin\bash.exe' || '' }} - RBT_WORKING_DIR: ${{ inputs.working-directory }} steps: - shell: bash + env: + BAZEL_SH: ${{ startswith(inputs.os, 'windows-') && 'C:\msys64\usr\bin\bash.exe' || '' }} + RBT_WORKING_DIR: ${{ inputs.working-directory }} run: | [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" bazel test "//..." From 4246e6af5bb814dfc2b2951d3ff0e62863330505 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 08:32:43 -0700 Subject: [PATCH 06/16] Try not setting BAZEL_SH for non-Windows runners. --- .github/actions/run_bazel_test/action.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml index c787c56..12c87a3 100644 --- a/.github/actions/run_bazel_test/action.yaml +++ b/.github/actions/run_bazel_test/action.yaml @@ -10,9 +10,24 @@ inputs: runs: using: composite steps: + # - shell: bash + # env: + # BAZEL_SH: ${{ startswith(inputs.os, 'windows-') && 'C:\msys64\usr\bin\bash.exe' || '' }} + # RBT_WORKING_DIR: ${{ inputs.working-directory }} + # run: | + # [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" + # bazel test "//..." - shell: bash + if: ${{ startswith(inputs.os, 'windows-') }} + env: + BAZEL_SH: 'C:\msys64\usr\bin\bash.exe' + RBT_WORKING_DIR: ${{ inputs.working-directory }} + run: | + [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" + bazel test "//..." + - shell: bash + if: ${{ ! startswith(inputs.os, 'windows-') }} env: - BAZEL_SH: ${{ startswith(inputs.os, 'windows-') && 'C:\msys64\usr\bin\bash.exe' || '' }} RBT_WORKING_DIR: ${{ inputs.working-directory }} run: | [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" From 5b6693c3deecb1e3a1657e87dd1e1cab513fd796 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 08:34:39 -0700 Subject: [PATCH 07/16] Use single quotes for package specifier. --- .github/actions/run_bazel_test/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml index 12c87a3..20639be 100644 --- a/.github/actions/run_bazel_test/action.yaml +++ b/.github/actions/run_bazel_test/action.yaml @@ -24,12 +24,12 @@ runs: RBT_WORKING_DIR: ${{ inputs.working-directory }} run: | [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" - bazel test "//..." + bazel test '//...' - shell: bash if: ${{ ! startswith(inputs.os, 'windows-') }} env: RBT_WORKING_DIR: ${{ inputs.working-directory }} run: | [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" - bazel test "//..." + bazel test '//...' From 727f29311e56c6d4f0fab2440174dd96f88a4d70 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 08:40:23 -0700 Subject: [PATCH 08/16] Add debug code --- .github/actions/run_bazel_test/action.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml index 20639be..4357ca6 100644 --- a/.github/actions/run_bazel_test/action.yaml +++ b/.github/actions/run_bazel_test/action.yaml @@ -24,6 +24,9 @@ runs: RBT_WORKING_DIR: ${{ inputs.working-directory }} run: | [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" + # DEBUG BEGIN + set -x + # DEBUG END bazel test '//...' - shell: bash if: ${{ ! startswith(inputs.os, 'windows-') }} From bd5382b7f35935af432f07e331861c786684bd38 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 08:44:01 -0700 Subject: [PATCH 09/16] More debug --- .github/actions/run_bazel_test/action.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml index 4357ca6..bcd3f40 100644 --- a/.github/actions/run_bazel_test/action.yaml +++ b/.github/actions/run_bazel_test/action.yaml @@ -26,6 +26,8 @@ runs: [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" # DEBUG BEGIN set -x + uname_output="$( uname -a )" + echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") uname_output: ${uname_output}" # DEBUG END bazel test '//...' - shell: bash From 7ceca0a522fe2fe0c16f3bafb1bb64ecfda0bcf1 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 08:54:52 -0700 Subject: [PATCH 10/16] Use shell script --- .github/actions/run_bazel_test/action.yaml | 40 ++++++++++--------- .../actions/run_bazel_test/run_bazel_test.sh | 22 ++++++++++ 2 files changed, 44 insertions(+), 18 deletions(-) create mode 100755 .github/actions/run_bazel_test/run_bazel_test.sh diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml index bcd3f40..a3e5b0d 100644 --- a/.github/actions/run_bazel_test/action.yaml +++ b/.github/actions/run_bazel_test/action.yaml @@ -4,6 +4,7 @@ description: Handles platform-specific settings. inputs: working-directory: type: string + # TODO: REMOVE os input os: type: string @@ -17,24 +18,27 @@ runs: # run: | # [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" # bazel test "//..." + # - shell: bash + # if: ${{ startswith(inputs.os, 'windows-') }} + # env: + # BAZEL_SH: 'C:\msys64\usr\bin\bash.exe' + # RBT_WORKING_DIR: ${{ inputs.working-directory }} + # run: | + # [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" + # # DEBUG BEGIN + # set -x + # uname_output="$( uname -a )" + # echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") uname_output: ${uname_output}" + # # DEBUG END + # bazel test '//...' + # - shell: bash + # if: ${{ ! startswith(inputs.os, 'windows-') }} + # env: + # RBT_WORKING_DIR: ${{ inputs.working-directory }} + # run: | + # [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" + # bazel test '//...' - shell: bash - if: ${{ startswith(inputs.os, 'windows-') }} - env: - BAZEL_SH: 'C:\msys64\usr\bin\bash.exe' - RBT_WORKING_DIR: ${{ inputs.working-directory }} - run: | - [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" - # DEBUG BEGIN - set -x - uname_output="$( uname -a )" - echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") uname_output: ${uname_output}" - # DEBUG END - bazel test '//...' - - shell: bash - if: ${{ ! startswith(inputs.os, 'windows-') }} env: RBT_WORKING_DIR: ${{ inputs.working-directory }} - run: | - [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" - bazel test '//...' - + run: ${GITHUB_ACTION_PATH}/run_bazel_test.sh diff --git a/.github/actions/run_bazel_test/run_bazel_test.sh b/.github/actions/run_bazel_test/run_bazel_test.sh new file mode 100755 index 0000000..5d467e0 --- /dev/null +++ b/.github/actions/run_bazel_test/run_bazel_test.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +is_windows() { + local os_name + os_name="$( uname )" + # Examples: MINGW64_NT-10.0-17763 + [[ "${os_name}" =~ ^MING ]] +} + +working_dir="${RBT_WORKING_DIR:-}" + +if is_windows; then + export BAZEL_SH='C:\msys64\usr\bin\bash.exe' +fi + +if [[ "${working_dir:-}" != "" ]]; then + cd "${working_dir}" +fi + +bazel test '//...' From dc9f11ed493cce3e8c31bfbaa37173d5d9ed4d2d Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 11:03:45 -0700 Subject: [PATCH 11/16] Use different package specifiers. --- .github/actions/run_bazel_test/run_bazel_test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/run_bazel_test/run_bazel_test.sh b/.github/actions/run_bazel_test/run_bazel_test.sh index 5d467e0..52bbe8f 100755 --- a/.github/actions/run_bazel_test/run_bazel_test.sh +++ b/.github/actions/run_bazel_test/run_bazel_test.sh @@ -13,10 +13,17 @@ working_dir="${RBT_WORKING_DIR:-}" if is_windows; then export BAZEL_SH='C:\msys64\usr\bin\bash.exe' + bzl_pkgs='///...' +else + bzl_pkgs='//...' fi if [[ "${working_dir:-}" != "" ]]; then cd "${working_dir}" fi -bazel test '//...' +# DEBUG BEGIN +set -x +# DEBUG END + +bazel test "${bzl_pkgs}" From 264b2e30934c9b719524f5aec7e1f0afb3d298a4 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 11:28:44 -0700 Subject: [PATCH 12/16] Debug --- .github/actions/run_bazel_test/action.yaml | 30 ------------------- .../actions/run_bazel_test/run_bazel_test.sh | 4 ++- .github/workflows/workflow.yaml | 3 -- 3 files changed, 3 insertions(+), 34 deletions(-) diff --git a/.github/actions/run_bazel_test/action.yaml b/.github/actions/run_bazel_test/action.yaml index a3e5b0d..5da088e 100644 --- a/.github/actions/run_bazel_test/action.yaml +++ b/.github/actions/run_bazel_test/action.yaml @@ -4,40 +4,10 @@ description: Handles platform-specific settings. inputs: working-directory: type: string - # TODO: REMOVE os input - os: - type: string runs: using: composite steps: - # - shell: bash - # env: - # BAZEL_SH: ${{ startswith(inputs.os, 'windows-') && 'C:\msys64\usr\bin\bash.exe' || '' }} - # RBT_WORKING_DIR: ${{ inputs.working-directory }} - # run: | - # [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" - # bazel test "//..." - # - shell: bash - # if: ${{ startswith(inputs.os, 'windows-') }} - # env: - # BAZEL_SH: 'C:\msys64\usr\bin\bash.exe' - # RBT_WORKING_DIR: ${{ inputs.working-directory }} - # run: | - # [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" - # # DEBUG BEGIN - # set -x - # uname_output="$( uname -a )" - # echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") uname_output: ${uname_output}" - # # DEBUG END - # bazel test '//...' - # - shell: bash - # if: ${{ ! startswith(inputs.os, 'windows-') }} - # env: - # RBT_WORKING_DIR: ${{ inputs.working-directory }} - # run: | - # [[ "${RBT_WORKING_DIR:-}" != "" ]] && cd "${RBT_WORKING_DIR}" - # bazel test '//...' - shell: bash env: RBT_WORKING_DIR: ${{ inputs.working-directory }} diff --git a/.github/actions/run_bazel_test/run_bazel_test.sh b/.github/actions/run_bazel_test/run_bazel_test.sh index 52bbe8f..50861f1 100755 --- a/.github/actions/run_bazel_test/run_bazel_test.sh +++ b/.github/actions/run_bazel_test/run_bazel_test.sh @@ -23,7 +23,9 @@ if [[ "${working_dir:-}" != "" ]]; then fi # DEBUG BEGIN -set -x +echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") =============" +echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") PWD: ${PWD}" +find . -type d >&2 # DEBUG END bazel test "${bzl_pkgs}" diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 26071ff..0b838d7 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -62,13 +62,10 @@ jobs: - name: Run Bazel test at root if: ${{ matrix.bazel_mode == 'workspace' }} uses: ./.github/actions/run_bazel_test - with: - os: ${{ matrix.os }} - name: Run Bazel test under tests directory uses: ./.github/actions/run_bazel_test with: working-directory: tests - os: ${{ matrix.os }} # - name: Run tests (bzlmod) # if: matrix.bazel_mode == 'module' From 905c0bf97c9a5add81c60e3ea781c4b3d5ad44f4 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 11:39:49 -0700 Subject: [PATCH 13/16] Do not test root with Windows per the original logic. --- .github/workflows/workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 0b838d7..e420262 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -60,7 +60,7 @@ jobs: echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc echo "USE_BAZEL_VERSION=${{ matrix.version }}" > tests/.bazeliskrc - name: Run Bazel test at root - if: ${{ matrix.bazel_mode == 'workspace' }} + if: ${{ matrix.bazel_mode == 'workspace' && matrix.os != 'windows-2019' }} uses: ./.github/actions/run_bazel_test - name: Run Bazel test under tests directory uses: ./.github/actions/run_bazel_test From aa7f965c084e20afa7d902a49706ed40e022fa4e Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 11:50:26 -0700 Subject: [PATCH 14/16] Clean up --- .github/workflows/workflow.yaml | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index e420262..e16e2cd 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -59,43 +59,14 @@ jobs: run: | echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc echo "USE_BAZEL_VERSION=${{ matrix.version }}" > tests/.bazeliskrc - - name: Run Bazel test at root + - name: Run Bazel test at the root if: ${{ matrix.bazel_mode == 'workspace' && matrix.os != 'windows-2019' }} uses: ./.github/actions/run_bazel_test - - name: Run Bazel test under tests directory + - name: Run Bazel test under the tests directory uses: ./.github/actions/run_bazel_test with: working-directory: tests - # - name: Run tests (bzlmod) - # if: matrix.bazel_mode == 'module' - # working-directory: ./tests - # run: | - # echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc - - # if [[ ${{ runner.os }} == Windows ]]; then - # # On Windows `//...` expands to `/...`. - # BAZEL_SH='C:\msys64\usr\bin\bash.exe' bazel test ///... - # else - # bazel test //... - # fi - - # - name: Run tests (workspace) - # if: matrix.bazel_mode == 'workspace' - # run: | - # echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc - # echo "USE_BAZEL_VERSION=${{ matrix.version }}" > tests/.bazeliskrc - - # if [[ ${{ runner.os }} == Windows ]]; then - # # Because of the docstring quote issue on Windows we skip the stardoc test on the main workspace. - # # On Windows `//...` expands to `/...`. - # cd tests && BAZEL_SH='C:\msys64\usr\bin\bash.exe' bazel test ///... - # else - # bazel test //... - - # cd tests && bazel test //... - # fi - all_ci_tests: runs-on: ubuntu-latest needs: From 71392373a8b93c70ce3108d04406d01e162f8952 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 12:56:22 -0700 Subject: [PATCH 15/16] Remove comments. --- .github/actions/run_bazel_test/run_bazel_test.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/actions/run_bazel_test/run_bazel_test.sh b/.github/actions/run_bazel_test/run_bazel_test.sh index 50861f1..4faa10d 100755 --- a/.github/actions/run_bazel_test/run_bazel_test.sh +++ b/.github/actions/run_bazel_test/run_bazel_test.sh @@ -22,10 +22,4 @@ if [[ "${working_dir:-}" != "" ]]; then cd "${working_dir}" fi -# DEBUG BEGIN -echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") =============" -echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") PWD: ${PWD}" -find . -type d >&2 -# DEBUG END - bazel test "${bzl_pkgs}" From 412973bb47f4a8ecc619ad5ce804859d9a101f8b Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 14 Dec 2023 14:38:12 -0700 Subject: [PATCH 16/16] Fix variable check. --- .github/actions/run_bazel_test/run_bazel_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/run_bazel_test/run_bazel_test.sh b/.github/actions/run_bazel_test/run_bazel_test.sh index 4faa10d..9ced3d3 100755 --- a/.github/actions/run_bazel_test/run_bazel_test.sh +++ b/.github/actions/run_bazel_test/run_bazel_test.sh @@ -18,7 +18,7 @@ else bzl_pkgs='//...' fi -if [[ "${working_dir:-}" != "" ]]; then +if [[ -n "${working_dir:-}" ]]; then cd "${working_dir}" fi