Skip to content

Commit c536e39

Browse files
DragaDoncilaDraga DoncilapsobolewskiPhDjni
authored
Fix test_all_plugins workflow (#370)
Since ages ago, the `test_all_plugins.yml` workflow was no longer usable because the GHA matrix allows for a maximum of 256 jobs, and we have far more plugins than that. This PR updates the workflow to: - use npe2api to retrieve the plugin index, instead of the napari hub API - randomly select 10 plugins from the list of all plugins (eventually we may want to update this to select the latest updated plugins or something) - use the `$GITHUB_OUTPUT` environment file to set the matrix strategy output instead of `::set-output` command which is [soon to be deprecated](https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/) - use `miniforge3` instead of `mambaforge` for setting up conda because [a warning in an action](https://github.com/napari/npe2/actions/runs/12823522845/job/35758149192#step:4:16) said so Note the workflow is still triggered in the same ways: via manual dispatch, or via the `test-all-plugins` label added to a PR --------- Co-authored-by: Draga Doncila <[email protected]> Co-authored-by: Peter Sobolewski <[email protected]> Co-authored-by: Juan Nunez-Iglesias <[email protected]>
1 parent fbcaac8 commit c536e39

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/test_all_plugins.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Test all plugins
22

33
on:
4+
# To run this workflow, trigger it manually, or add the label 'test-all-plugins' to a pull request
45
pull_request:
56
types: [ labeled ]
67
workflow_dispatch:
@@ -15,7 +16,13 @@ jobs:
1516
runs-on: ubuntu-latest
1617
steps:
1718
- id: plugin_names
18-
run: echo "::set-output name=plugins::$(curl -s https://api.napari-hub.org/plugins | jq -c 'keys')"
19+
# Query npe2api for index of all plugins, select the keys, turn them into an array, select 10 random
20+
# names from that array, convert the "one per line" output back into a string array
21+
# save the string array of 10 plugins into the output from this step
22+
run: |
23+
set -eux
24+
DATA=$(echo $(curl -s https://npe2api.vercel.app/api/plugins | jq -c 'keys' | jq -r '.[]' | shuf -n 10 | jq -R -s 'split("\n") | map(select(. != ""))'))
25+
echo "plugins=$DATA" >> "$GITHUB_OUTPUT"
1926
outputs:
2027
plugins: ${{ steps.plugin_names.outputs.plugins }}
2128

@@ -38,8 +45,9 @@ jobs:
3845

3946
- uses: conda-incubator/setup-miniconda@v3
4047
with:
41-
python-version: 3.9
42-
miniforge-variant: Mambaforge
48+
python-version: '3.10'
49+
miniforge-variant: Miniforge3
50+
conda-remove-defaults: "true"
4351
miniforge-version: latest
4452
use-mamba: true
4553

0 commit comments

Comments
 (0)