Skip to content

Test Emscripten/Pyodide build #6

Test Emscripten/Pyodide build

Test Emscripten/Pyodide build #6

Workflow file for this run

name: Test Emscripten/Pyodide build
on:
pull_request:
branches:
- main
- maintenance/**
# Note: this workflow gets triggered on the same schedule as the
# wheels.yml workflow to upload WASM wheels to Anaconda.org.
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
- cron: "42 2 * * SUN,WED"
workflow_dispatch:
inputs:
push_wheels:
# Can be 'true' or 'false'. Default is 'false'.
# Warning: this will overwrite existing wheels.
description: >
Push wheels to Anaconda.org if the build succeeds
required: false
default: 'false'
env:
FORCE_COLOR: 3
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-wasm-emscripten:
permissions:
contents: read # to fetch code (actions/checkout)
name: Build NumPy distribution for Pyodide
runs-on: ubuntu-22.04
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
steps:
- name: Checkout NumPy
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
fetch-tags: true
- uses: pypa/cibuildwheel@79b0dd328794e1180a7268444d46cdf12e1abd01 # v2.21.0
env:
CIBW_PLATFORM: pyodide
- name: Upload wheel artifact(s)
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: cp312-pyodide_wasm32
path: ./wheelhouse/*.whl
if-no-files-found: error
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
# WARNING: this job will overwrite any existing WASM wheels.
upload-wheels:
name: Upload NumPy WASM wheels to Anaconda.org
runs-on: ubuntu-22.04
permissions: {}
needs: [build-wasm-emscripten]
if: >-
(github.repository == 'numpy/numpy') &&
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
(github.event_name == 'schedule')
steps:
- name: Download wheel artifact(s)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: wheelhouse/
merge-multiple: true
- name: Push to Anaconda PyPI index
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
with:
artifacts_path: wheelhouse/
anaconda_nightly_upload_token: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}