From 0d091c0d331a02b08d466d00693e65a0e192bf1f Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 18 Nov 2024 22:13:43 +0100 Subject: [PATCH 1/7] try concatenating without passing through json --- .github/workflows/ci.yml | 2 +- action.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a99cedf..4195c03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: id: action-run continue-on-error: true with: - environment-paths: "${{ toJSON(matrix.env-paths) }}" + environment-paths: ${{ matrix.env-paths }} - name: detect outcome if: always() shell: bash -l {0} diff --git a/action.yaml b/action.yaml index f9f852a..d3e4bc6 100644 --- a/action.yaml +++ b/action.yaml @@ -6,7 +6,7 @@ inputs: description: >- The paths to the environment files required: True - type: string + type: list outputs: {} runs: @@ -23,4 +23,4 @@ runs: COLUMNS: 120 FORCE_COLOR: 3 run: | - python minimum_versions.py ${{ join(fromJSON(inputs.environment-paths), ' ') }} + python minimum_versions.py ${{ join(inputs.environment-paths, ' ') }} From 39f908cdeb61e0b68810c8cea5f51c2f42c753e5 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 18 Nov 2024 22:38:39 +0100 Subject: [PATCH 2/7] unpack multiple envs into a string --- .github/workflows/ci.yml | 15 ++++++++++----- action.yaml | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4195c03..ae5755a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,14 +44,19 @@ jobs: fail-fast: false matrix: env-paths: - - ["envs/env1.yaml"] - - ["envs/env2.yaml"] - - ["envs/env1.yaml", "envs/env2.yaml"] + - "envs/env1.yaml" + - "envs/env2.yaml" + - | + envs/env1.yaml + envs/env2.yaml expected-failure: ["false"] include: - - env-paths: ["envs/failing-env1.yaml"] + - env-paths: | + envs/failing-env1.yaml expected-failure: "true" - - env-paths: ["envs/env1.yaml", "envs/failing-env1.yaml"] + - env-paths: | + envs/env1.yaml + envs/failing-env1.yaml expected-failure: "true" steps: diff --git a/action.yaml b/action.yaml index d3e4bc6..2e7dd5c 100644 --- a/action.yaml +++ b/action.yaml @@ -23,4 +23,4 @@ runs: COLUMNS: 120 FORCE_COLOR: 3 run: | - python minimum_versions.py ${{ join(inputs.environment-paths, ' ') }} + python minimum_versions.py "${{ inputs.environment-paths }}" From b2d5dd7205d163c6b9440be83a7ead2343ea19d4 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 18 Nov 2024 22:41:12 +0100 Subject: [PATCH 3/7] try going through a environment variable --- action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 2e7dd5c..d42843d 100644 --- a/action.yaml +++ b/action.yaml @@ -22,5 +22,6 @@ runs: env: COLUMNS: 120 FORCE_COLOR: 3 + INPUT: ${{ inputs.environment-paths }} run: | - python minimum_versions.py "${{ inputs.environment-paths }}" + python minimum_versions.py "$(echo $INPUT)" From 381b4adcc41f2c7fbbcec546d741a0ca8da885ac Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 18 Nov 2024 22:42:00 +0100 Subject: [PATCH 4/7] don't quote --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index d42843d..4690209 100644 --- a/action.yaml +++ b/action.yaml @@ -24,4 +24,4 @@ runs: FORCE_COLOR: 3 INPUT: ${{ inputs.environment-paths }} run: | - python minimum_versions.py "$(echo $INPUT)" + python minimum_versions.py $(echo $INPUT) From e341029e1e5230c0d861991700d64db0bc7e2446 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 18 Nov 2024 22:49:16 +0100 Subject: [PATCH 5/7] demonstrate the basic usage --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b480a5..f401b74 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,5 @@ jobs: - uses: xarray-contrib/minimum-dependency-versions@version with: - ... + environment-paths: path/to/env.yaml ``` From 2c2e7a8b0af5a937653e2dbe6a8f72ac5506da49 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 18 Nov 2024 22:49:46 +0100 Subject: [PATCH 6/7] add the steps key --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f401b74..fc16fb5 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ To use the `minimum-dependency-versions` action in workflows, simply add a new s jobs: my-job: ... - + steps: + ... - uses: xarray-contrib/minimum-dependency-versions@version with: environment-paths: path/to/env.yaml From 602d9c1d0a654efaa93bc74a9425fb248c15401e Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 18 Nov 2024 22:50:01 +0100 Subject: [PATCH 7/7] demonstrate how to analyze multiple envs at the same time --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index fc16fb5..0939659 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,20 @@ jobs: with: environment-paths: path/to/env.yaml ``` + +To analyze multiple environments at the same time, pass a multi-line string: + +```yaml +jobs: + my-job: + ... + steps: + ... + + - uses: xarray-contrib/minimum-dependency-versions@version + with: + environment-paths: | + path/to/env1.yaml + path/to/env2.yaml + path/to/env3.yaml +```