Merge branch 'Feature_Numpy2.0' #1188
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: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
readme: | |
container: iquiw/alpine-emacs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- run: emacs --batch README.org --eval '(org-md-export-to-markdown)' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: README | |
path: README.md | |
test: | |
strategy: | |
matrix: | |
runs-on: [ubuntu-latest, macos-13, macos-14, windows-latest] | |
python: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
numpy: ["numpy<2.0.0", "numpy>=2.0.0rc2"] | |
gym: ['gym', 'gymnasium'] | |
exclude: | |
- python: "3.8" | |
numpy: "numpy>=2.0.0rc2" | |
fail-fast: false | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: pip cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ runner.os }}-pip${{ matrix.python }} | |
restore-keys: ${{ runner.os }}-pip${{ matrix.python }} | |
- name: Install NumPy | |
run: pip install '${{ matrix.numpy }}' | |
- name: Install cpprb | |
run: pip install '.[all]' | |
- name: Install Gym(nasium) | |
run: pip install ${{ matrix.gym }} | |
- run: python -m unittest discover . '*.py' | |
working-directory: './test' | |
build_winmac: | |
needs: readme | |
strategy: | |
matrix: | |
runs-on: [macos-13, macos-14, windows-latest] | |
fail-fast: false | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.8 | |
3.9 | |
3.10 | |
3.11 | |
3.12 | |
- name: Get pip cache dir | |
id: pip-cache | |
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: pip cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ runner.os }}-pip | |
restore-keys: ${{ runner.os }}-pip | |
- uses: actions/download-artifact@v4 | |
with: | |
name: README | |
path: README | |
- run: mv README/README.md README.md | |
- run: pip3.8 wheel . -w dist --no-deps | |
- run: pip3.9 wheel . -w dist --no-deps | |
- run: pip3.10 wheel . -w dist --no-deps | |
- run: pip3.11 wheel . -w dist --no-deps | |
- run: pip3.12 wheel . -w dist --no-deps | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.runs-on }} | |
path: dist | |
- name: Upload to PyPI | |
run: python -m twine upload -u __token__ -p ${{ secrets.pypi_password }} --skip-existing dist/cpprb-* | |
if: github.event_name == 'push' && startsWith(github.event.ref,'refs/tags/v') | |
continue-on-error: true | |
build_targz: | |
needs: readme | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: README | |
path: README | |
- run: mv README/README.md README.md | |
- run: python setup.py build_ext sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-sdist | |
path: dist | |
- run: pip install twine | |
- name: Upload to PyPI | |
run: python -m twine upload -u __token__ -p ${{ secrets.pypi_password }} --skip-existing dist/cpprb-*tar.gz | |
if: github.event_name == 'push' && startsWith(github.event.ref,'refs/tags/v') | |
build_manylinux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: ["x86_64", "aarch64"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3' | |
- uses: docker/setup-qemu-action@v3 | |
if: ${{ matrix.arch }} == "aarch64" | |
with: | |
platforms: arm64 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/build-push-action@v5 | |
with: | |
push: false | |
build-args: | | |
ON_CI=1 | |
arch=${{ matrix.arch }} | |
file: Dockerfile | |
cache-to: type=gha,mode=max,scope=${{github.ref_name}} | |
cache-from: type=gha,scope=${{github.ref_name}} | |
load: true | |
tags: cpprb/wheel:latest | |
- run: | | |
docker create --name wheel cpprb/wheel:latest | |
docker cp wheel:/dist/. dist/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-manylinux-${{ matrix.arch }} | |
path: dist | |
- run: pip install twine | |
- name: Upload to PyPI | |
run: python -m twine upload -u __token__ -p ${{ secrets.pypi_password }} --skip-existing dist/cpprb-* | |
if: github.event_name == 'push' && startsWith(github.event.ref,'refs/tags/v') |