Add CI workflow that builds and tests from the sdist tarball
Runs only on the latest Python version, on both platforms.
@@ -55,3 +55,50 @@ jobs:
export PYTHONPATH=$(echo $GITHUB_WORKSPACE/build/lib.*)
export REF_PATH=':'
pytest
+
+
+ sdist:
+ runs-on: ${{ matrix.os }}-latest
+ strategy:
+ matrix:
+ os: [ubuntu, macos]
+ python-version: [3.9]
+
+ steps:
+ - name: Checkout pysam
+ uses: actions/checkout@v2
+
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install prerequisite Python libraries
+ run: pip install cython pytest pytest-pep8
+
+ - name: Install build prerequisites
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get update
+ sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev
+
+ - name: Create source distribution
+ run: python setup.py sdist
+
+ - name: Build (via sdist tarball)
+ run: pip install --verbose --no-deps --no-binary=':all:' pysam-*.tar.gz
+ working-directory: dist
+
+ - name: Install test prerequisites
+ run: |
+ case $RUNNER_OS in
+ Linux)
+ sudo apt-get install -q --no-install-recommends --no-install-suggests samtools bcftools tabix
+ ;;
+ macOS)
+ brew install -q samtools bcftools
+ ;;
+ esac
+
+ - name: Run tests
+ run: REF_PATH=':' pytest
