Skip to content

next release v1.0.7 #115

next release v1.0.7

next release v1.0.7 #115

Workflow file for this run

name: Test
on:
push:
pull_request:
schedule: [{cron: '30 23 * * 6'}] # M H d m w (Sat at 23:30)
workflow_dispatch:
jobs:
clang-format:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: {python-version: '3.x'}
- run: sudo apt-get install -yqq clang-format
- uses: pre-commit/[email protected]
with: {extra_args: --all-files clang-format}
test:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: py${{ matrix.python }}
runs-on: ubuntu-${{ matrix.python == 3.7 && '22.04' || 'latest' }}
strategy:
matrix:
python: [3.7, 3.12]
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: pip install -U -e .[dev]
# in-place for pytest (-e . doesn't work yet for scikit-build-core)
run: |
pip install toml
python -c 'import toml; c=toml.load("pyproject.toml")
print("\0".join(c["build-system"]["requires"] + ["cmake>=" + c["tool"]["scikit-build"]["cmake"]["minimum-version"]]), end="")' \
| xargs -0 pip install ninja
pip install --no-build-isolation --no-deps -t . -U -v . -Ccmake.define.CUVEC_DEBUG=1
git restore numcu/src
python -c 'import toml; c=toml.load("pyproject.toml")
print("\0".join(c["project"]["dependencies"] + c["project"]["optional-dependencies"]["dev"]), end="")' \
| xargs -0 pip install
- run: pytest
- uses: codecov/codecov-action@v5
- name: compile -Wall
run: |
git clean -Xdf
pip install build
python -m build -n -w \
-Ccmake.define.CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type"
cuda:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: CUDA py${{ matrix.python }}
runs-on: [self-hosted, cuda, python]
strategy:
matrix:
python: [3.7, 3.12]
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0}
- name: Run setup-python
run: setup-python -p${{ matrix.python }}
- name: pip install -U -e .[dev]
# in-place for pytest (-e . doesn't work yet for scikit-build-core)
run: |
pip install toml
python -c 'import toml; c=toml.load("pyproject.toml")
print("\0".join(c["build-system"]["requires"] + ["cmake>=" + c["tool"]["scikit-build"]["cmake"]["minimum-version"]]), end="")' \
| xargs -0 pip install ninja
pip install --no-build-isolation --no-deps -t . -U -v . -Ccmake.define.CUVEC_DEBUG=1
git restore numcu/src
python -c 'import toml; c=toml.load("pyproject.toml")
print("\0".join(c["project"]["dependencies"] + c["project"]["optional-dependencies"]["dev"]), end="")' \
| xargs -0 pip install
- run: pytest
- uses: codecov/codecov-action@v5
- name: compile -Wall
run: |
git clean -Xdf
pip install build
python -m build -n -w \
-Ccmake.define.CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type" \
-Ccmake.define.CMAKE_CUDA_ARCHITECTURES=all
- name: Post Run setup-python
run: setup-python -p${{ matrix.python }} -Dr
if: ${{ always() }}
deploy:
needs: [clang-format, test, cuda]
name: PyPI Deploy
environment: pypi
permissions: {contents: write, id-token: write}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN || github.token }}
- uses: actions/setup-python@v5
with: {python-version: '3.x'}
- id: dist
uses: casperdcl/deploy-pypi@v2
with:
build: -s
upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Release
run: |
changelog=$(git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD)
tag="${GITHUB_REF#refs/tags/}"
gh release create --title "NumCu $tag stable" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.targz }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Docs
run: |
pushd docs
pip install -U -r requirements.txt
PYTHONPATH=. pydoc-markdown --build --site-dir=../../../dist/site
popd
- if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }}
uses: casperdcl/push-dir@v1
with:
message: update static site
branch: gh-pages
history: false
dir: dist/site
nojekyll: true
name: AMYPAD[bot]
email: [email protected]