From 02192dd87a84059e4417c06d9b877441c2e4fc89 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Tue, 4 Mar 2025 12:46:12 +0000 Subject: [PATCH 1/6] install-cylc-components: respect login shell --- install-cylc-components/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install-cylc-components/action.yml b/install-cylc-components/action.yml index 998f426..caef7ea 100644 --- a/install-cylc-components/action.yml +++ b/install-cylc-components/action.yml @@ -77,7 +77,8 @@ runs: using: composite steps: - name: Fetch meta-release info - shell: bash + # NOTE: use login shell to allow us to work with setup-micromamba + shell: bash -el {0} run: | wget \ https://raw.githubusercontent.com/cylc/cylc-admin/master/docs/status/branches.json @@ -91,7 +92,7 @@ runs: (inputs.metomi_rose == 'true' && !inputs.metomi_rose_tag) || (inputs.cylc_rose == 'true' && !inputs.cylc_rose_tag) id: get_tag - shell: bash + shell: bash -el {0} env: META_RELEASE: ${{ inputs.meta_release }} BASE_BRANCH: ${{ github.base_ref || github.ref }} @@ -99,7 +100,7 @@ runs: run: "${{ github.action_path }}/../bin/pick_compatible_branches" - name: Install - shell: bash + shell: bash -el {0} env: cylc_flow: ${{ inputs.cylc_flow_tag || steps.get_tag.outputs.cylc_flow }} cylc_uis: ${{ inputs.cylc_uiserver_tag || steps.get_tag.outputs.cylc_uiserver }} From bcba242fb745e50eb5709682d2ad880a5ea2e96b Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Wed, 5 Mar 2025 11:07:29 +0000 Subject: [PATCH 2/6] Apply suggestions from code review --- install-cylc-components/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install-cylc-components/action.yml b/install-cylc-components/action.yml index caef7ea..3039670 100644 --- a/install-cylc-components/action.yml +++ b/install-cylc-components/action.yml @@ -78,7 +78,7 @@ runs: steps: - name: Fetch meta-release info # NOTE: use login shell to allow us to work with setup-micromamba - shell: bash -el {0} + shell: bash -eulo pipefail {0} run: | wget \ https://raw.githubusercontent.com/cylc/cylc-admin/master/docs/status/branches.json @@ -92,7 +92,7 @@ runs: (inputs.metomi_rose == 'true' && !inputs.metomi_rose_tag) || (inputs.cylc_rose == 'true' && !inputs.cylc_rose_tag) id: get_tag - shell: bash -el {0} + shell: bash -eulo pipefail {0} env: META_RELEASE: ${{ inputs.meta_release }} BASE_BRANCH: ${{ github.base_ref || github.ref }} @@ -100,7 +100,7 @@ runs: run: "${{ github.action_path }}/../bin/pick_compatible_branches" - name: Install - shell: bash -el {0} + shell: bash -eulo pipefail {0} env: cylc_flow: ${{ inputs.cylc_flow_tag || steps.get_tag.outputs.cylc_flow }} cylc_uis: ${{ inputs.cylc_uiserver_tag || steps.get_tag.outputs.cylc_uiserver }} From a8c8ae914d1dfba50969efa5edbbc910154c8c57 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Wed, 5 Mar 2025 11:16:18 +0000 Subject: [PATCH 3/6] Apply suggestions from code review --- install-cylc-components/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install-cylc-components/action.yml b/install-cylc-components/action.yml index 3039670..5e9167d 100644 --- a/install-cylc-components/action.yml +++ b/install-cylc-components/action.yml @@ -78,7 +78,7 @@ runs: steps: - name: Fetch meta-release info # NOTE: use login shell to allow us to work with setup-micromamba - shell: bash -eulo pipefail {0} + shell: bash -elo pipefail {0} run: | wget \ https://raw.githubusercontent.com/cylc/cylc-admin/master/docs/status/branches.json @@ -92,7 +92,7 @@ runs: (inputs.metomi_rose == 'true' && !inputs.metomi_rose_tag) || (inputs.cylc_rose == 'true' && !inputs.cylc_rose_tag) id: get_tag - shell: bash -eulo pipefail {0} + shell: bash -elo pipefail {0} env: META_RELEASE: ${{ inputs.meta_release }} BASE_BRANCH: ${{ github.base_ref || github.ref }} @@ -100,7 +100,7 @@ runs: run: "${{ github.action_path }}/../bin/pick_compatible_branches" - name: Install - shell: bash -eulo pipefail {0} + shell: bash -elo pipefail {0} env: cylc_flow: ${{ inputs.cylc_flow_tag || steps.get_tag.outputs.cylc_flow }} cylc_uis: ${{ inputs.cylc_uiserver_tag || steps.get_tag.outputs.cylc_uiserver }} From 2f16a6c02eaeda7e5086fa2637173935a28c9180 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Thu, 6 Mar 2025 13:52:07 +0000 Subject: [PATCH 4/6] install-cylc-components: add simple test --- .github/workflows/test.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fcda4ba..1ec9311 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -156,3 +156,25 @@ jobs: meta_releases_dict = json.loads('${{ steps.test-set-meta-releases.outputs.meta-releases-dict }}') assert isinstance(meta_releases_dict, dict) assert len(meta_releases_dict) > 0 + + test-install-cylc-components: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: checkout repo + uses: actions/checkout@v4 + + - name: setup python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: install-cylc-components + uses: ./install-cylc-components + with: + cylc_flow: true + cylc_flow_tag: 8.4.0 + + - name: test + run: | + [[ $(cylc version) == 8.4.0 ]] From 8891060d77bad2db8857444a8879a2b0cdbe6301 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Mon, 10 Mar 2025 09:54:08 +0000 Subject: [PATCH 5/6] install-cylc-components: test micromamba python --- .github/workflows/test.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ec9311..bd54d37 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -160,15 +160,29 @@ jobs: test-install-cylc-components: runs-on: ubuntu-latest timeout-minutes: 5 + strategy: + matrix: + action: ['setup-python', 'setup-micromamba'] steps: - name: checkout repo uses: actions/checkout@v4 - name: setup python + if: startsWith(matrix.os, 'setup-python') uses: actions/setup-python@v5 with: python-version: '3.10' + - name: setup python + if: startsWith(matrix.os, 'setup-micromamba') + uses: mamba-org/setup-micromamba@v2 + with: + cache-environment: true + post-cleanup: 'all' + environment-name: test + create-args: + python=3.10 + - name: install-cylc-components uses: ./install-cylc-components with: @@ -176,5 +190,6 @@ jobs: cylc_flow_tag: 8.4.0 - name: test + shell: bash -elo pipefail {0} run: | [[ $(cylc version) == 8.4.0 ]] From 267ab8f2ab9730a442bf85bf48d4605fc8787350 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Mon, 10 Mar 2025 16:34:30 +0000 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd54d37..adacf71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -168,13 +168,13 @@ jobs: uses: actions/checkout@v4 - name: setup python - if: startsWith(matrix.os, 'setup-python') + if: matrix.action == 'setup-python' uses: actions/setup-python@v5 with: python-version: '3.10' - name: setup python - if: startsWith(matrix.os, 'setup-micromamba') + if: matrix.action == 'setup-micromamba' uses: mamba-org/setup-micromamba@v2 with: cache-environment: true