Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Split package build from testing #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 46 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,53 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build
run: python -m build
- name: Upload source distribution
uses: actions/upload-artifact@v3
with:
name: sdist
path: "dist/*.tar.gz"
if-no-files-found: error
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: wheel
path: "dist/*.whl"
if-no-files-found: error

test:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ['3.10', '3.9', '3.8', '3.7'] # pypy3

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest cffi

- name: Build
run: |
pip install -e .

- name: Cache Mono
if: runner.os == 'Windows'
uses: actions/cache@v2
Expand All @@ -47,6 +66,22 @@ jobs:
run: |
choco install -y mono ${{ matrix.python == 'pypy3' && '--x86' || '' }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest

- name: Download wheel
uses: actions/download-artifact@v3
with:
name: wheel
path: dist/

- name: Install wheel
shell: bash
run: |
pip install dist/*.whl

- name: Test with pytest
run: |
pytest
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[build-system]
requires = ["setuptools>=61", "wheel"]
requires = ["setuptools>=61", "setuptools_scm[toml]", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "clr_loader"
description = "Generic pure Python loader for .NET runtimes"
license = {text = "MIT"}
version = "0.2.3"
requires-python = ">=3.7"

readme = "README.md"

Expand All @@ -22,6 +22,8 @@ classifiers = [
"Operating System :: MacOS :: MacOS X",
]

dynamic = ["version"]

[[project.authors]]
name = "Benedikt Reinartz"
email = "[email protected]"
Expand All @@ -37,6 +39,8 @@ package-data = {"clr_loader.ffi" = ["dlls/x86/*.dll", "dlls/amd64/*.dll"]}
[tool.setuptools.packages.find]
include = ["clr_loader*"]

[tool.setuptools_scm]

[tool.pytest.ini_options]
xfail_strict = true
testpaths = [
Expand Down