Update build.yml #49
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: Build packages with Pyodide | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run_build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - repo: https://github.com/Pylons/paginate | |
# name: paginate | |
# version: "0.5.6" | |
# - repo: https://github.com/gorakhargosh/watchdog | |
# name: watchdog | |
# version: "v2.3.1" | |
# - repo: https://github.com/gorakhargosh/watchdog | |
# name: watchdog | |
# version: "v3.0.0" | |
# - repo: https://github.com/kuelumbus/rdkit-pypi/ | |
# name: rdkit-pypi | |
# version: "rdkit-pypi" | |
# - repo: https://github.com/ssciwr/ipywidgets-jsonschema | |
# name: ipywidgets-jsonschema | |
# package-name: ipywidgets_jsonschema | |
# version: "v1.1.0" | |
# - repo: https://github.com/spglib/spglib/ | |
# name: spglib | |
# package-name: spglib | |
# version: "v2.5.0" | |
- repo: https://github.com/materialsproject/pymatgen/ | |
name: pymatgen | |
package-name: pymatgen | |
version: "v2024.11.13" | |
# - repo: https://github.com/pydantic/pydantic/ | |
# name: pydantic | |
# package-name: pydantic | |
# version: "v2.7.1" | |
# - repo: https://github.com/pydantic/pydantic-core/ | |
# name: pydantic-core | |
# package-name: pydantic_core | |
# version: "v2.18.2" | |
# # https://stackoverflow.com/questions/48675235/error-the-option-z-is-only-accepted-on-the-nightly-compiler | |
# # https://stackoverflow.com/questions/56389460/compilation-error-cant-find-crate-for-core | |
# command: rustup install nightly && rustup default nightly && rustup target add wasm32-unknown-emscripten | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.2 | |
- name: Set up env vars for Emscripten | |
run: | | |
set -vxeuo pipefail | |
pip install pyodide-build==0.24.0 | |
# Currently deployed version for jupyterlite.mat3ra.com | |
# export EMSCRIPTEN_VERSION="3.1.45" | |
export EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) | |
echo EMSCRIPTEN_VERSION=${EMSCRIPTEN_VERSION} >> $GITHUB_ENV | |
echo "EMSCRIPTEN_VERSION is $EMSCRIPTEN_VERSION" | |
- name: Set up Emscripten | |
uses: mymindstorm/setup-emsdk@v14 | |
with: | |
version: ${{ env.EMSCRIPTEN_VERSION }} | |
- name: Build with Pyodide | |
run: | | |
set -vxeuo pipefail | |
if [[ ! -z "${{ matrix.command }}" ]]; then | |
${{ matrix.command }} | |
fi | |
# exports only needed for pymatgen | |
export CFLAGS="-DLONG_BIT=64 -DSIZEOF_VOID_P=8 -D_FILE_OFFSET_BITS=64" | |
export CXXFLAGS="-DLONG_BIT=64 -DSIZEOF_VOID_P=8 -D_FILE_OFFSET_BITS=64" | |
git clone --depth 1 --branch ${{ matrix.version }} ${{ matrix.repo }} | |
cd ${{ matrix.name }} | |
pyodide build | |
ls -la | |
tree . | |
- name: Upload built artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.package-name }}-${{ matrix.version }} | |
path: ${{ matrix.name }}/dist/${{ matrix.package-name }}-*.whl |