Bump codecov/codecov-action from 3 to 5 #16
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: Tests | |
on: [push, pull_request] | |
jobs: | |
build_sdist: | |
name: Build and test on Python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9, "3.10", 3.11, 3.12, 3.13] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: |- | |
python -m pip install --upgrade pip | |
python -m pip install setuptools>=0.8 wheel build | |
- name: Build sdist | |
shell: bash | |
run: |- | |
python -m build --sdist --outdir wheelhouse | |
- name: Install sdist | |
run: |- | |
ls -al ./wheelhouse | |
pip install pytest pytest-cov | |
pip install Cython | |
pip install wheelhouse/*.tar.gz -v | |
- name: Test sdist | |
run: |- | |
pwd | |
ls -al | |
# Run in a sandboxed directory | |
WORKSPACE_DNAME="testsrcdir_minimal_${{ matrix.python-version }}_${GITHUB_RUN_ID}_${RUNNER_OS}" | |
mkdir -p $WORKSPACE_DNAME | |
cd $WORKSPACE_DNAME | |
# Get path to installed package | |
MOD_NAME=lark_cython | |
MOD_DPATH=$(python -c "import $MOD_NAME, os; print(os.path.dirname($MOD_NAME.__file__))") | |
echo "MOD_DPATH = $MOD_DPATH" | |
# Run the tests | |
python -m pytest --cov=$MOD_NAME $MOD_DPATH ../tests | |
cd .. |