Files
WeKnora/.github/workflows/plugin-sdk.yml
T
wizardchen 55379d5b2a ci(pluginsdk): run the Python job's steps in bash on Windows too
The job's own run defaults replaced the workflow's shell: bash, so Windows
ran the example step in PowerShell, where ( cd ... ) is no subshell and the
second cd started from the first one's directory.
2026-09-26 11:00:11 +08:00

83 lines
2.3 KiB
YAML

name: Plugin SDK
# Builds and tests the pluginsdk/ Go module (extension protocol, Go SDK,
# client and conformance suite) and the Python SDK in pluginsdk/python on
# every push / PR that touches them. The Go conformance suite also runs the
# Python SDK's test plugin.
on:
push:
branches: [main]
paths:
- 'pluginsdk/**'
- 'examples/plugins/notebooks/**'
- 'examples/plugins/links/**'
- '.github/workflows/plugin-sdk.yml'
pull_request:
paths:
- 'pluginsdk/**'
- 'examples/plugins/notebooks/**'
- 'examples/plugins/links/**'
- '.github/workflows/plugin-sdk.yml'
defaults:
run:
working-directory: pluginsdk
shell: bash
permissions:
contents: read
jobs:
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26'
cache-dependency-path: pluginsdk/go.mod
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: go build
run: go build ./...
- name: go test
run: go test -race ./...
- name: go vet
run: go vet ./...
python:
name: python ${{ matrix.python }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, python: '3.9' }
- { os: ubuntu-latest, python: '3.13' }
- { os: windows-latest, python: '3.13' }
defaults:
run:
working-directory: pluginsdk/python
# A job's run defaults replace the workflow's, shell included.
shell: bash
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: unittest
run: python -W error::ResourceWarning -m unittest discover -s tests -v
- name: example plugins
run: |
(cd ../../examples/plugins/notebooks && python -m unittest -v test_main)
(cd ../../examples/plugins/links && python -m unittest -v test_main)
- name: build the package
run: python -m pip install build && python -m build