Add Scalene profiler #106
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 normal wheels | |
on: [push, pull_request] | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: psf/black@stable | |
cross-build: | |
runs-on: ubuntu-latest | |
container: wpilib/roborio-cross-ubuntu:2024-22.04-py312 | |
strategy: | |
matrix: | |
# | |
# Add packages here and in packages.toml! | |
# | |
package: | |
- Cython | |
- debugpy | |
- MarkupSafe | |
- numpy | |
- pydevd | |
- pyinstrument | |
- PyYAML | |
- scalene | |
- zope.interface | |
steps: | |
- uses: actions/checkout@v3 | |
# temporary fix | |
- run: /build/venv/bin/cross-python -m pip config set global.extra-index-url https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2024/simple | |
- shell: bash | |
name: Install script requirements | |
run: | | |
/build/venv/bin/cross-python -m \ | |
pip --disable-pip-version-check install -r requirements.txt | |
/build/venv/bin/build-python -m \ | |
pip --disable-pip-version-check install -r requirements.txt | |
- shell: bash | |
name: Determine if ${{ matrix.package }} should be built | |
id: check | |
run: | | |
/build/venv/bin/cross-python should_build.py ${{ matrix.package }} | |
- if: steps.check.outputs.should_build == 'true' | |
name: Install extra requirements for ${{ matrix.package }} | |
shell: bash | |
run: | | |
/build/venv/bin/build-python whl_deps.py build ${{ matrix.package }} | |
/build/venv/bin/cross-python whl_deps.py cross ${{ matrix.package }} | |
- if: steps.check.outputs.should_build == 'true' | |
name: Build ${{ matrix.package }} wheel | |
id: build | |
shell: bash | |
run: | | |
/build/venv/bin/cross-python whl_build.py ${{ matrix.package }} | |
- if: steps.check.outputs.should_build == 'true' | |
name: Modify ${{ matrix.package }} wheel | |
shell: bash | |
run: | | |
/build/venv/bin/cross-python whl_mod.py ${{ steps.build.outputs.wheel }} | |
ls dist/* | |
# Some packages are stupid | |
- name: Remove extra wheels | |
if: steps.check.outputs.should_build == 'true' | |
shell: bash | |
run: | | |
mkdir tmp | |
mv dist/${{ matrix.package }}*.whl tmp/ | |
rm -rf dist | |
mv tmp dist | |
# Upload package so that users can download the package directly | |
# by just issuing a PR | |
- uses: actions/upload-artifact@v2 | |
if: steps.check.outputs.should_build == 'true' | |
with: | |
name: ${{ matrix.package }} | |
path: dist/ | |
# | |
# Publish wheel to robotpy site | |
# | |
- name: Publish package to WPILib artifactory | |
if: steps.check.outputs.should_build == 'true' && github.event_name == 'push' && github.event.ref == 'refs/heads/2024' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: ${{ secrets.WPI_ARTIFACTORY_USERNAME }} | |
password: ${{ secrets.WPI_ARTIFACTORY_TOKEN }} | |
repository-url: https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2024-local | |