Skip to content

Commit

Permalink
Update cibuildwheel action
Browse files Browse the repository at this point in the history
Revert to old github artifact actions

wip

wip

wip

wip
  • Loading branch information
Erotemic committed Apr 27, 2024
1 parent 5e0bb27 commit 790b6cd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
echo "MOD_DPATH = $MOD_DPATH"
python -m pytest --verbose --cov={self.mod_name} $MOD_DPATH ../tests
cd ..
- uses: actions/upload-artifact@v4.3.1
- uses: actions/upload-artifact@v3.1.3
name: Upload sdist artifact
with:
name: sdist_wheels
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
with:
platforms: all
- name: Build binary wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.16.5
with:
output-dir: wheelhouse
config-file: pyproject.toml
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v4.3.1
- uses: actions/upload-artifact@v3.1.3
name: Upload wheels artifact
with:
name: wheels
Expand Down Expand Up @@ -325,7 +325,7 @@ jobs:
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4.1.2
- uses: actions/download-artifact@v2.1.1
name: Download wheels
with:
name: wheels
Expand Down Expand Up @@ -405,12 +405,12 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v4.1.2
- uses: actions/download-artifact@v2.1.1
name: Download wheels
with:
name: wheels
path: wheelhouse
- uses: actions/download-artifact@v4.1.2
- uses: actions/download-artifact@v2.1.1
name: Download sdist
with:
name: sdist_wheels
Expand Down Expand Up @@ -459,7 +459,7 @@ jobs:
ots stamp wheelhouse/*.whl wheelhouse/*.tar.gz wheelhouse/*.asc
ls -la wheelhouse
twine upload --username __token__ --password "$TWINE_PASSWORD" --repository-url "$TWINE_REPOSITORY_URL" wheelhouse/*.whl wheelhouse/*.tar.gz --skip-existing --verbose || { echo "failed to twine upload" ; exit 1; }
- uses: actions/upload-artifact@v4.3.1
- uses: actions/upload-artifact@v3.1.3
name: Upload deploy artifacts
with:
name: deploy_artifacts
Expand All @@ -480,12 +480,12 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v4.1.2
- uses: actions/download-artifact@v2.1.1
name: Download wheels
with:
name: wheels
path: wheelhouse
- uses: actions/download-artifact@v4.1.2
- uses: actions/download-artifact@v2.1.1
name: Download sdist
with:
name: sdist_wheels
Expand Down Expand Up @@ -534,7 +534,7 @@ jobs:
ots stamp wheelhouse/*.whl wheelhouse/*.tar.gz wheelhouse/*.asc
ls -la wheelhouse
twine upload --username __token__ --password "$TWINE_PASSWORD" --repository-url "$TWINE_REPOSITORY_URL" wheelhouse/*.whl wheelhouse/*.tar.gz --skip-existing --verbose || { echo "failed to twine upload" ; exit 1; }
- uses: actions/upload-artifact@v4.3.1
- uses: actions/upload-artifact@v3.1.3
name: Upload deploy artifacts
with:
name: deploy_artifacts
Expand All @@ -555,7 +555,7 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v4.1.2
- uses: actions/download-artifact@v2.1.1
name: Download artifacts
with:
name: deploy_artifacts
Expand Down
26 changes: 20 additions & 6 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,39 @@ def copy_coverage_cibuildwheel_docker(runner_project_dir):
print(f'No installed version of {package_name} found')

try:
print('Changing dirs to test_dir={!r}'.format(test_dir))
os.chdir(test_dir)
# print('Changing dirs to test_dir={!r}'.format(test_dir))
# os.chdir(test_dir)

import pathlib
modpath_contents = list(pathlib.Path(modpath).glob('*'))
print(f'modpath_contents = {ub.urepr(modpath_contents, nl=1)}')
testdir_contents = list(pathlib.Path(test_dir).glob('*'))
print(f'testdir_contents = {ub.urepr(testdir_contents, nl=1)}')

pyproject_fpath = join(repo_dir, 'pyproject.toml')

pytest_args = [
'--cov-config', '../pyproject.toml',
'--cov-config', pyproject_fpath,
'--cov-report', 'html',
'--cov-report', 'term',
'--cov-report', 'xml',
'--cov=' + package_name,
modpath, '.'
modpath, test_dir
]
if is_cibuildwheel():
pytest_args.append('--cov-append')

pytest_args = pytest_args + sys.argv[1:]
sys.exit(pytest.main(pytest_args))
print(f'Exec pytest with args={pytest_args}')
ret = pytest.main(pytest_args)
print(f'pytest returned ret={ret}')
except Exception as ex:
print(f'pytest exception: {ex}')
ret = 1
finally:
os.chdir(cwd)
# os.chdir(cwd)
if is_cibuildwheel():
# for CIBW under linux
copy_coverage_cibuildwheel_docker(f'/home/runner/work/{package_name}/{package_name}')
print('Restoring cwd = {!r}'.format(cwd))
sys.exit(ret)

0 comments on commit 790b6cd

Please sign in to comment.