Add a tests for building Python extensions #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: e2e-extension | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
push: | |
branches: | |
- main | |
- releases/* | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
python-extension: | |
name: Test building extensions (Python ${{ matrix.python-version}}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.9', 'pypy-3.9-v7.x'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: ./ | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: pip install setuptools | |
- name: Build extension | |
run: pip install . | |
working-directory: __tests__/data/extension/ | |
- name: Check output | |
run: | | |
output=$(python3 -c "import helloworld; helloworld.say_hello('world')") | |
test "$output" == "Hello, world!" |