-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Erotemic/dev/2.2.2
Remove codecov from tests
- Loading branch information
Showing
7 changed files
with
117 additions
and
98 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,10 @@ jobs: | |
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
- name: Set up Python 3.11 for linting | ||
uses: actions/[email protected] | ||
with: | ||
python-version: 3.8 | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: |- | ||
python -m pip install --upgrade pip | ||
|
@@ -29,15 +29,15 @@ jobs: | |
# stop the build if there are Python syntax errors or undefined names | ||
flake8 ./vtool_ibeis --count --select=E9,F63,F7,F82 --show-source --statistics | ||
build_and_test_sdist: | ||
name: Test sdist Python 3.8 | ||
name: Build sdist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
- name: Set up Python 3.11 | ||
uses: actions/[email protected] | ||
with: | ||
python-version: 3.8 | ||
python-version: '3.11' | ||
- name: Upgrade pip | ||
run: |- | ||
python -m pip install --upgrade pip | ||
|
@@ -53,7 +53,7 @@ jobs: | |
- name: Install sdist | ||
run: |- | ||
ls -al ./wheelhouse | ||
pip install wheelhouse/vtool_ibeis*.tar.gz -v | ||
pip install --prefer-binary wheelhouse/vtool_ibeis*.tar.gz -v | ||
- name: Test minimal loose sdist | ||
run: |- | ||
pwd | ||
|
@@ -114,8 +114,7 @@ jobs: | |
- name: Build pure wheel | ||
shell: bash | ||
run: |- | ||
python -m pip install pip -U | ||
python -m pip install setuptools>=0.8 build | ||
python -m pip install setuptools>=0.8 wheel build | ||
python -m build --wheel --outdir wheelhouse | ||
- name: Show built files | ||
shell: bash | ||
|
@@ -134,32 +133,32 @@ jobs: | |
matrix: | ||
include: | ||
- python-version: '3.7' | ||
os: ubuntu-latest | ||
install-extras: tests-strict,runtime-strict,headless-strict | ||
os: ubuntu-latest | ||
arch: auto | ||
- python-version: '3.11' | ||
os: ubuntu-latest | ||
install-extras: tests-strict,runtime-strict,optional-strict,headless-strict | ||
os: ubuntu-latest | ||
arch: auto | ||
- python-version: '3.7' | ||
os: ubuntu-latest | ||
install-extras: tests,optional,headless | ||
os: ubuntu-latest | ||
arch: auto | ||
- python-version: '3.8' | ||
os: ubuntu-latest | ||
install-extras: tests,optional,headless | ||
os: ubuntu-latest | ||
arch: auto | ||
- python-version: '3.9' | ||
os: ubuntu-latest | ||
install-extras: tests,optional,headless | ||
os: ubuntu-latest | ||
arch: auto | ||
- python-version: '3.10' | ||
os: ubuntu-latest | ||
install-extras: tests,optional,headless | ||
os: ubuntu-latest | ||
arch: auto | ||
- python-version: '3.11' | ||
os: ubuntu-latest | ||
install-extras: tests,optional,headless | ||
os: ubuntu-latest | ||
arch: auto | ||
steps: | ||
- name: Checkout source | ||
|
@@ -174,57 +173,73 @@ jobs: | |
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/download-artifact@v3 | ||
name: Download wheels and sdist | ||
name: Download wheels | ||
with: | ||
name: wheels | ||
path: wheelhouse | ||
- name: Test wheel with ${{ matrix.install-extras }} | ||
- name: Install wheel ${{ matrix.install-extras }} | ||
shell: bash | ||
env: | ||
INSTALL_EXTRAS: ${{ matrix.install-extras }} | ||
CI_PYTHON_VERSION: py${{ matrix.python-version }} | ||
run: |- | ||
# Find the path to the wheel | ||
ls wheelhouse | ||
echo "Finding the path to the wheel" | ||
ls wheelhouse || echo "wheelhouse does not exist" | ||
echo "Installing helpers" | ||
pip install setuptools>=0.8 setuptools_scm wheel build -U | ||
pip install tomli pkginfo | ||
MOD_NAME=vtool_ibeis | ||
echo "MOD_NAME=$MOD_NAME" | ||
WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('$MOD_NAME*.whl'))[-1]).replace(chr(92), chr(47)))") | ||
echo "WHEEL_FPATH=$WHEEL_FPATH" | ||
MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)") | ||
echo "MOD_VERSION=$MOD_VERSION" | ||
# Install the wheel (ensure we are using the version we just built) | ||
# NOTE: THE VERSION MUST BE NEWER THAN AN EXISTING PYPI VERSION OR THIS MAY FAIL | ||
pip install --prefer-binary "$MOD_NAME[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse | ||
# Create a sandboxed directory | ||
WORKSPACE_DNAME="testdir_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}" | ||
export WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('vtool_ibeis*.whl'))[-1]).replace(chr(92), chr(47)))") | ||
export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)") | ||
pip install --prefer-binary "vtool_ibeis[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse | ||
echo "Install finished." | ||
- name: Test wheel ${{ matrix.install-extras }} | ||
shell: bash | ||
env: | ||
CI_PYTHON_VERSION: py${{ matrix.python-version }} | ||
run: |- | ||
echo "Creating test sandbox directory" | ||
export WORKSPACE_DNAME="testdir_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}" | ||
echo "WORKSPACE_DNAME=$WORKSPACE_DNAME" | ||
mkdir -p $WORKSPACE_DNAME | ||
echo "cd-ing into the workspace" | ||
cd $WORKSPACE_DNAME | ||
pwd | ||
ls -altr | ||
# Get the path to the installed package and run the tests | ||
MOD_DPATH=$(python -c "import vtool_ibeis, os; print(os.path.dirname(vtool_ibeis.__file__))") | ||
echo "MOD_DPATH = $MOD_DPATH" | ||
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov="$MOD_NAME" "$MOD_DPATH" ../tests | ||
export MOD_DPATH=$(python -c "import vtool_ibeis, os; print(os.path.dirname(vtool_ibeis.__file__))") | ||
echo " | ||
--- | ||
MOD_DPATH = $MOD_DPATH | ||
--- | ||
running the pytest command inside the workspace | ||
--- | ||
" | ||
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov="vtool_ibeis" "$MOD_DPATH" ../tests | ||
echo "pytest command finished, moving the coverage file to the repo root" | ||
ls -al | ||
# Move coverage file to a new name | ||
mv .coverage "../.coverage.$WORKSPACE_DNAME" | ||
echo "changing directory back to th repo root" | ||
cd .. | ||
ls -al | ||
- name: Combine coverage Linux | ||
if: runner.os == 'Linux' | ||
run: |- | ||
echo '############ PWD' | ||
pwd | ||
cp .wheelhouse/.coverage* . || true | ||
ls -al | ||
python -m pip install coverage[toml] | ||
echo '############ combine' | ||
coverage combine . | ||
coverage combine . || true | ||
echo '############ XML' | ||
coverage xml -o ./tests/coverage.xml | ||
echo '############ FIND' | ||
find . -name .coverage.* | ||
find . -name coverage.xml | ||
coverage xml -o ./coverage.xml || true | ||
echo '### The cwd should now have a coverage.xml' | ||
ls -altr | ||
pwd | ||
- uses: codecov/codecov-action@v3 | ||
name: Codecov Upload | ||
with: | ||
file: ./tests/coverage.xml | ||
file: ./coverage.xml | ||
test_deploy: | ||
name: Uploading Test to PyPi | ||
runs-on: ubuntu-latest | ||
|
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
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
Oops, something went wrong.