From 351c57db9f174f41a428c051af00a7c15ba413f4 Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 09:37:51 -0800 Subject: [PATCH 01/13] TST: test composite workflow --- .github/actions/run_tests/action.yml | 24 ++++++++++++++++++++++++ .github/workflows/composite_test.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/actions/run_tests/action.yml create mode 100644 .github/workflows/composite_test.yml diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml new file mode 100644 index 0000000..40c87cd --- /dev/null +++ b/.github/actions/run_tests/action.yml @@ -0,0 +1,24 @@ +name: "run tests" +description: "set up and run the full environment unit test suite" +inputs: + use-tag: + description: "Whether or not to test against the tag" + required: true + default: false + CHECKOUT_TOKEN: + description: "checkout token for internal repositories" + required: false + default: "" +runs: + using: "composite" + # Maybe someday default shell will be supported for actions, not just workflows + # defaults: + # run: + # shell: bash --login -eo pipefail {0} + steps: + - run: | + echo $${{ TOKEN }} + echo $${{ inputs.CHECKOUT_TOKEN }} + env: + TOKEN: ${{ inputs.CHECKOUT_TOKEN }} + shell: bash --login -eo pipefail {0} \ No newline at end of file diff --git a/.github/workflows/composite_test.yml b/.github/workflows/composite_test.yml new file mode 100644 index 0000000..2a2b186 --- /dev/null +++ b/.github/workflows/composite_test.yml @@ -0,0 +1,27 @@ +name: Sample composite workflow + +on: + pull_request: + release: + types: + - published + +env: + MPLBACKEND: "agg" + QT_QPA_PLATFORM: "offscreen" + +jobs: + # The latest deployed env OR the proposed env in a PR + current-tests: + defaults: + run: + shell: bash --login -eo pipefail {0} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/run_tests + with: + use-tag: true + CHECKOUT_TOKEN: ${{ secrets.TOKEN || github.token }} \ No newline at end of file From 102733d284fae2a44685f87959651b25f8e148dd Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 09:42:50 -0800 Subject: [PATCH 02/13] env vars without {} --- .github/actions/run_tests/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index 40c87cd..ce44ff4 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -17,7 +17,7 @@ runs: # shell: bash --login -eo pipefail {0} steps: - run: | - echo $${{ TOKEN }} + echo $TOKEN echo $${{ inputs.CHECKOUT_TOKEN }} env: TOKEN: ${{ inputs.CHECKOUT_TOKEN }} From 36e9580b0aa29698a98ef0e1cd2d3e7cf16a9042 Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 11:07:55 -0800 Subject: [PATCH 03/13] wip --- .github/actions/run_tests/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index ce44ff4..9d449e6 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -19,6 +19,9 @@ runs: - run: | echo $TOKEN echo $${{ inputs.CHECKOUT_TOKEN }} + git clone "https://username:${TOKEN}@github.com/pcdshub/pytmc" --depth 1 + cd pytmc + git submodule update --init --recursive env: TOKEN: ${{ inputs.CHECKOUT_TOKEN }} shell: bash --login -eo pipefail {0} \ No newline at end of file From 02b6dff43dc5af2ae462fe2068b1e7d37ab8b7d8 Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 11:16:55 -0800 Subject: [PATCH 04/13] only use secrets --- .github/workflows/composite_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/composite_test.yml b/.github/workflows/composite_test.yml index 2a2b186..6a97f9b 100644 --- a/.github/workflows/composite_test.yml +++ b/.github/workflows/composite_test.yml @@ -24,4 +24,4 @@ jobs: - uses: ./.github/actions/run_tests with: use-tag: true - CHECKOUT_TOKEN: ${{ secrets.TOKEN || github.token }} \ No newline at end of file + CHECKOUT_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file From 68a6cb0f68d952bae3924aca2d812ec65afdc040 Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 11:23:40 -0800 Subject: [PATCH 05/13] helper print --- .github/actions/run_tests/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index 9d449e6..2467afa 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -21,6 +21,7 @@ runs: echo $${{ inputs.CHECKOUT_TOKEN }} git clone "https://username:${TOKEN}@github.com/pcdshub/pytmc" --depth 1 cd pytmc + pwd git submodule update --init --recursive env: TOKEN: ${{ inputs.CHECKOUT_TOKEN }} From 4759cb83d3b215836fc99caa4a70c0897b9804eb Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 11:34:26 -0800 Subject: [PATCH 06/13] remove username --- .github/actions/run_tests/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index 2467afa..81f1470 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -19,7 +19,7 @@ runs: - run: | echo $TOKEN echo $${{ inputs.CHECKOUT_TOKEN }} - git clone "https://username:${TOKEN}@github.com/pcdshub/pytmc" --depth 1 + git clone "https://${TOKEN}@github.com/pcdshub/pytmc" --depth 1 cd pytmc pwd git submodule update --init --recursive From 644cf8df6d1930f9152a8ac6811ec6af47f4b742 Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 11:44:03 -0800 Subject: [PATCH 07/13] recurse submodules on clone --- .github/actions/run_tests/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index 81f1470..979b907 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -19,10 +19,11 @@ runs: - run: | echo $TOKEN echo $${{ inputs.CHECKOUT_TOKEN }} - git clone "https://${TOKEN}@github.com/pcdshub/pytmc" --depth 1 + git clone "https://${TOKEN}@github.com/pcdshub/pytmc" --depth 1 --recurse-submodules cd pytmc pwd - git submodule update --init --recursive + # git submodule update --init --recursive + ls ./pytmc/tests/projects/lcls-plc-kfe-xgmd-vac env: TOKEN: ${{ inputs.CHECKOUT_TOKEN }} shell: bash --login -eo pipefail {0} \ No newline at end of file From c607f5fd2a1868724bbf2efdc7e0d3e0c5f8c318 Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 11:57:47 -0800 Subject: [PATCH 08/13] try configuring submodules --- .github/actions/run_tests/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index 979b907..937e9b6 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -19,10 +19,11 @@ runs: - run: | echo $TOKEN echo $${{ inputs.CHECKOUT_TOKEN }} - git clone "https://${TOKEN}@github.com/pcdshub/pytmc" --depth 1 --recurse-submodules + git clone "https://${TOKEN}@github.com/pcdshub/pytmc" --depth 1 cd pytmc pwd - # git submodule update --init --recursive + git config --global url."https://${{ inputs.CHECKOUT_TOKEN }}@github.com".insteadOf "https://github.com/" + git submodule update --init --recursive ls ./pytmc/tests/projects/lcls-plc-kfe-xgmd-vac env: TOKEN: ${{ inputs.CHECKOUT_TOKEN }} From 859def4e20616d059d5fe1d5633bbcc6f1751cf4 Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 11:59:01 -0800 Subject: [PATCH 09/13] forgot a slash --- .github/actions/run_tests/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index 937e9b6..12efa0d 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -22,7 +22,7 @@ runs: git clone "https://${TOKEN}@github.com/pcdshub/pytmc" --depth 1 cd pytmc pwd - git config --global url."https://${{ inputs.CHECKOUT_TOKEN }}@github.com".insteadOf "https://github.com/" + git config --global url."https://${{ inputs.CHECKOUT_TOKEN }}@github.com/".insteadOf "https://github.com/" git submodule update --init --recursive ls ./pytmc/tests/projects/lcls-plc-kfe-xgmd-vac env: From f6e1c40491d206d7190d5a3ffc49e9a98eb93eda Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 12:26:52 -0800 Subject: [PATCH 10/13] top level clone an internal repo --- .github/actions/run_tests/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index 12efa0d..9cd787d 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -19,6 +19,7 @@ runs: - run: | echo $TOKEN echo $${{ inputs.CHECKOUT_TOKEN }} + git clone "https://${TOKEN}@github.com/pcdshub/lcls-plc-kfe-xgmd-vac" --depth 1 git clone "https://${TOKEN}@github.com/pcdshub/pytmc" --depth 1 cd pytmc pwd From 9e1ac38d7ef1ebab8a6fb189ddfd9a7289367fab Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 13:08:02 -0800 Subject: [PATCH 11/13] n/a --- .github/actions/run_tests/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/run_tests/action.yml b/.github/actions/run_tests/action.yml index 9cd787d..a68bce4 100644 --- a/.github/actions/run_tests/action.yml +++ b/.github/actions/run_tests/action.yml @@ -17,6 +17,7 @@ runs: # shell: bash --login -eo pipefail {0} steps: - run: | + echo "start script" echo $TOKEN echo $${{ inputs.CHECKOUT_TOKEN }} git clone "https://${TOKEN}@github.com/pcdshub/lcls-plc-kfe-xgmd-vac" --depth 1 From 3c83ea3ff23c64c55909fece3e2e2946f1feaad7 Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 14:21:18 -0800 Subject: [PATCH 12/13] try environments --- .github/workflows/composite_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/composite_test.yml b/.github/workflows/composite_test.yml index 6a97f9b..6a17099 100644 --- a/.github/workflows/composite_test.yml +++ b/.github/workflows/composite_test.yml @@ -13,6 +13,7 @@ env: jobs: # The latest deployed env OR the proposed env in a PR current-tests: + environment: external-pr defaults: run: shell: bash --login -eo pipefail {0} From 9b88b879e85ee3bb0661d62d7f142f45537bc35b Mon Sep 17 00:00:00 2001 From: tangkong Date: Mon, 1 Dec 2025 14:31:35 -0800 Subject: [PATCH 13/13] use env secret, maybe shadowingf/ --- .github/workflows/composite_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/composite_test.yml b/.github/workflows/composite_test.yml index 6a17099..8bde229 100644 --- a/.github/workflows/composite_test.yml +++ b/.github/workflows/composite_test.yml @@ -25,4 +25,4 @@ jobs: - uses: ./.github/actions/run_tests with: use-tag: true - CHECKOUT_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file + CHECKOUT_TOKEN: ${{ secrets.ENV_SECRET }} \ No newline at end of file