Skip to content

Commit 6f9cf5a

Browse files
authored
try to avoid encoding as json (#5)
* try concatenating without passing through json * unpack multiple envs into a string * try going through a environment variable * don't quote * demonstrate the basic usage * add the steps key * demonstrate how to analyze multiple envs at the same time
1 parent e0dd5e5 commit 6f9cf5a

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

.github/workflows/ci.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,19 @@ jobs:
4444
fail-fast: false
4545
matrix:
4646
env-paths:
47-
- ["envs/env1.yaml"]
48-
- ["envs/env2.yaml"]
49-
- ["envs/env1.yaml", "envs/env2.yaml"]
47+
- "envs/env1.yaml"
48+
- "envs/env2.yaml"
49+
- |
50+
envs/env1.yaml
51+
envs/env2.yaml
5052
expected-failure: ["false"]
5153
include:
52-
- env-paths: ["envs/failing-env1.yaml"]
54+
- env-paths: |
55+
envs/failing-env1.yaml
5356
expected-failure: "true"
54-
- env-paths: ["envs/env1.yaml", "envs/failing-env1.yaml"]
57+
- env-paths: |
58+
envs/env1.yaml
59+
envs/failing-env1.yaml
5560
expected-failure: "true"
5661
5762
steps:
@@ -62,7 +67,7 @@ jobs:
6267
id: action-run
6368
continue-on-error: true
6469
with:
65-
environment-paths: "${{ toJSON(matrix.env-paths) }}"
70+
environment-paths: ${{ matrix.env-paths }}
6671
- name: detect outcome
6772
if: always()
6873
shell: bash -l {0}

README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,26 @@ To use the `minimum-dependency-versions` action in workflows, simply add a new s
1010
jobs:
1111
my-job:
1212
...
13+
steps:
14+
...
15+
- uses: xarray-contrib/minimum-dependency-versions@version
16+
with:
17+
environment-paths: path/to/env.yaml
18+
```
19+
20+
To analyze multiple environments at the same time, pass a multi-line string:
21+
22+
```yaml
23+
jobs:
24+
my-job:
25+
...
26+
steps:
27+
...
1328

1429
- uses: xarray-contrib/minimum-dependency-versions@version
1530
with:
16-
...
31+
environment-paths: |
32+
path/to/env1.yaml
33+
path/to/env2.yaml
34+
path/to/env3.yaml
1735
```

action.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
description: >-
77
The paths to the environment files
88
required: True
9-
type: string
9+
type: list
1010
outputs: {}
1111

1212
runs:
@@ -22,5 +22,6 @@ runs:
2222
env:
2323
COLUMNS: 120
2424
FORCE_COLOR: 3
25+
INPUT: ${{ inputs.environment-paths }}
2526
run: |
26-
python minimum_versions.py ${{ join(fromJSON(inputs.environment-paths), ' ') }}
27+
python minimum_versions.py $(echo $INPUT)

0 commit comments

Comments
 (0)