-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add macOS (incl. amd64) and Windows readme code CI checks (#1306)
- Loading branch information
Showing
3 changed files
with
78 additions
and
19 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 |
---|---|---|
|
@@ -14,22 +14,40 @@ on: | |
|
||
jobs: | ||
python: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-12, macos-14, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
- if: matrix.platform != 'macos-14' | ||
uses: actions/[email protected] | ||
with: | ||
python-version: 3.9 | ||
- run: pip install -e .[tests] | ||
- run: pip install pytest-codeblocks pytest | ||
- run: pip install "pyparsing<3.0.0" # https://github.com/matplotlib/matplotlib/issues/25204 | ||
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.py', 'w'); f.writelines(block.code for block in code if block.syntax=='Python'); f.close()" | ||
- run: python -We readme.py | ||
- run: sed -i 's/CPU/GPU/g' readme.py | ||
- run: python -We readme.py | ||
- if: matrix.platform == 'macos-14' | ||
run: | | ||
sudo ln -s `which python3` /usr/local/bin/python | ||
echo "PIP_INSTALL_ARGS=--break-system-packages" >> $GITHUB_ENV | ||
python -m pip install --break-system-packages setuptools # Python 3.12 workaround | ||
- run: python -m pip install $PIP_INSTALL_ARGS -e . | ||
- run: python -m pip install $PIP_INSTALL_ARGS pytest-codeblocks pytest | ||
- run: python -m pip install $PIP_INSTALL_ARGS "pyparsing<3.0.0" # https://github.com/matplotlib/matplotlib/issues/25204 | ||
- run: | | ||
python -c "import os,pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.py', 'w', encoding='utf-8'); f.write('# coding: utf-8'+os.linesep); f.writelines(block.code for block in code if block.syntax=='Python'); f.close()" | ||
- run: cat -n readme.py | ||
- if: matrix.platform == 'macos-14' | ||
run: | | ||
python readme.py | ||
sed -i -e 's/CPU/GPU/g' readme.py | ||
python readme.py | ||
- if: matrix.platform != 'macos-14' | ||
run: | | ||
python -We readme.py | ||
sed -i -e 's/CPU/GPU/g' readme.py | ||
python -We readme.py | ||
- name: artefacts | ||
if: github.ref == 'refs/heads/main' | ||
if: github.ref == 'refs/heads/main' && matrix.platform == 'macos-14' | ||
uses: eine/tip@master | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -49,7 +67,7 @@ jobs: | |
- uses: julia-actions/[email protected] | ||
- run: cat -n readme.jl | ||
- run: julia readme.jl | ||
- run: sed -i 's/CPU/GPU/g' readme.jl | ||
- run: sed -i -e 's/CPU/GPU/g' readme.jl | ||
- run: julia readme.jl | ||
|
||
matlab: | ||
|
@@ -69,7 +87,7 @@ jobs: | |
- uses: matlab-actions/[email protected] | ||
with: | ||
command: readme | ||
- run: sed -i 's/CPU/GPU/g' readme.m | ||
- run: sed -i -e 's/CPU/GPU/g' readme.m | ||
- uses: matlab-actions/[email protected] | ||
with: | ||
command: readme | ||
|
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 |
---|---|---|
|
@@ -197,7 +197,7 @@ jobs: | |
key: examples_pip_cache-${{ matrix.platform }}-${{ matrix.python-version }}-${{ env.toml_ci_md5 }} | ||
- if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
python -m pip install --upgrade --user pip | ||
python -m pip uninstall -y jupyterlab-server # https://github.com/pypa/pip/issues/6275 | ||
python -m pip install -e . ./examples | ||
python -m pip install -r tests/devops_tests/requirements.txt | ||
- if: steps.cache.outputs.cache-hit != 'true' | ||
|
@@ -302,19 +302,37 @@ jobs: | |
pkg_install_check: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.8", "3.11"] | ||
platform: [ubuntu-latest, macos-12, macos-14, windows-latest] | ||
python-version: ["3.8", "3.11", "system"] | ||
exclude: | ||
- platform: ubuntu-latest | ||
python-version: system | ||
- platform: macos-12 | ||
python-version: system | ||
- platform: windows-latest | ||
python-version: system | ||
- platform: macos-14 | ||
python-version: "3.8" | ||
- platform: macos-14 | ||
python-version: "3.11" | ||
runs-on: ${{ matrix.platform }} | ||
needs: [package] | ||
steps: | ||
- uses: actions/[email protected] | ||
- if: matrix.platform != 'macos-14' | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- if: matrix.platform == 'macos-14' | ||
run: | | ||
sudo ln -s `which python3` /usr/local/bin/python | ||
echo "PIP_INSTALL_ARGS=--break-system-packages" >> $GITHUB_ENV | ||
# Python 3.12 workaround | ||
python -m pip install --break-system-packages setuptools | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
- run: pip install dist/*.whl | ||
- run: python -m pip install $PIP_INSTALL_ARGS dist/*.whl | ||
- run: python -c "import PySDM; print(PySDM.__version__)" | ||
- run: python -c "import PySDM_examples; print(PySDM_examples.__version__)" | ||
|
||
|
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