File: test_all_plugins.yml

package info (click to toggle)
python-npe2 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 780 kB
  • sloc: python: 7,236; makefile: 19
file content (61 lines) | stat: -rw-r--r-- 2,067 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Test all plugins

on:
  # To run this workflow, trigger it manually, or add the label 'test-all-plugins' to a pull request
  pull_request:
    types: [ labeled ]
  workflow_dispatch:

concurrency:
  group: test-plugins-${{ github.ref }}
  cancel-in-progress: true

jobs:
  get-plugins:
    if: github.event.label.name == 'test-all-plugins' || github.event_name == 'workflow_dispatch'
    runs-on: ubuntu-latest
    steps:
      - id: plugin_names
        # Query npe2api for index of all plugins, select the keys, turn them into an array, select 10 random
        # names from that array, convert the "one per line" output back into a string array
        # save the string array of 10 plugins into the output from this step
        run: |
          set -eux
          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(. != ""))'))
          echo "plugins=$DATA" >> "$GITHUB_OUTPUT"
    outputs:
      plugins: ${{ steps.plugin_names.outputs.plugins }}

  test_all:
    needs: get-plugins
    name: ${{ matrix.plugin }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        plugin: ${{ fromJson(needs.get-plugins.outputs.plugins) }}
    defaults:
      run:
        shell: bash -l {0}

    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - uses: tlambert03/setup-qt-libs@19e4ef2d781d81f5f067182e228b54ec90d23b76 # v1.8

      - uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
        with:
          python-version: '3.10'
          miniforge-variant: Miniforge3
          conda-remove-defaults: "true"
          miniforge-version: latest
          use-mamba: true

      - name: Install npe2
        run: pip install -e .[testing]

      - run: sudo apt-get install -y xvfb
      - name: Run tests
        run: xvfb-run --auto-servernum pytest tests/test_all_plugins.py -s -v --color=yes
        env:
          TEST_PACKAGE_NAME: ${{ matrix.plugin }}