diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7b1f509 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,91 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: ${{ matrix.scope }} (${{ matrix.os }}, Python ${{ matrix.python-version }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + python-version: "3.10" + scope: Full tests + test-target: phylib + - os: ubuntu-latest + python-version: "3.11" + scope: Full tests + test-target: phylib + - os: ubuntu-latest + python-version: "3.12" + scope: Full tests + test-target: phylib + - os: macos-latest + python-version: "3.12" + scope: Full tests + test-target: phylib + - os: windows-latest + python-version: "3.12" + scope: Smoke tests + test-target: phylib/electrode phylib/stats phylib/utils + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: | + requirements.txt + requirements-dev.txt + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + python -m pip install -r requirements-dev.txt -e . + + - name: Run tests + run: python -m pytest ${{ matrix.test-target }} + + build: + name: Build package + runs-on: ubuntu-latest + needs: test + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Set up Python + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: requirements.txt + + - name: Build package + run: | + python -m pip install --upgrade build + python -m build + + - name: Upload build artifacts + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: dist + path: dist/ + if-no-files-found: error diff --git a/MANIFEST.in b/MANIFEST.in index 8a19ffa..905973d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ -include LICENSE +include LICENSE.md include README.md +include requirements.txt recursive-include tests * recursive-include phylib/electrode/probes *.prb