[SymForce-External] Speed up values.cc compilation #286
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: Test Editable Pip Install | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
workflow_dispatch: | |
jobs: | |
editable_install: | |
if: github.event.event_name == 'workflow_dispatch' || github.event.pull_request.draft == false | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, ubuntu-20.04, macos-12] | |
pip_version: [22.2.2] | |
setuptools_version: [65.3.0] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: install dev_requirements.txt | |
run: python3 -m pip install -r dev_requirements.txt | |
- name: Upgrade versions | |
run: | | |
python3 -m pip install pip==${{ matrix.pip_version }} | |
python3 -m pip install setuptools==${{ matrix.setuptools_version }} | |
# NOTE(brad): There seems to be a bug in pip which prevents editable installation | |
# in user directories. Seems to be resolved in 22.3.0. An alternative which works | |
# for older pip versions is to instead run `pip install --no-use-pep517 -e .` See | |
# https://github.com/pypa/pip/issues/7953 for more info. | |
- name: Update pip | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: python3 -m pip install pip==22.3.0 | |
- name: editable install | |
run: python3 -m pip install -e . | |
- name: Set expected install locations for ubuntu focal | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: | | |
echo CC_SYM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/cc_sym.cpython-38-x86_64-linux-gnu.so >> $GITHUB_ENV | |
echo SYM_LOCATION=/home/runner/.local/lib/python3.8/site-packages/sym/__init__.py >> $GITHUB_ENV | |
echo SKYMARSHAL_LOCATION=/home/runner/.local/lib/python3.8/site-packages/skymarshal/__init__.py >> $GITHUB_ENV | |
echo SYMENGINE_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV | |
echo LCMTYPES_SYM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/sym/__init__.py >> $GITHUB_ENV | |
echo LCMTYPES_EIGEN_LCM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/eigen_lcm/__init__.py >> $GITHUB_ENV | |
echo SF_SYMPY_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV | |
- name: Set expected install locations for ubuntu jammy | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: | | |
echo CC_SYM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/cc_sym.cpython-310-x86_64-linux-gnu.so >> $GITHUB_ENV | |
echo SYM_LOCATION=/home/runner/.local/lib/python3.10/site-packages/sym/__init__.py >> $GITHUB_ENV | |
echo SKYMARSHAL_LOCATION=/home/runner/.local/lib/python3.10/site-packages/skymarshal/__init__.py >> $GITHUB_ENV | |
echo SYMENGINE_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV | |
echo LCMTYPES_SYM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/sym/__init__.py >> $GITHUB_ENV | |
echo LCMTYPES_EIGEN_LCM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/eigen_lcm/__init__.py >> $GITHUB_ENV | |
echo SF_SYMPY_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV | |
- name: Set expected install locations for macos | |
if: ${{ matrix.os == 'macos-12' }} | |
run: | | |
echo CC_SYM_LOCATION=/Users/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/cc_sym.cpython-311-darwin.so >> $GITHUB_ENV | |
echo SYM_LOCATION=/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/sym/__init__.py >> $GITHUB_ENV | |
echo SKYMARSHAL_LOCATION=/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/skymarshal/__init__.py >> $GITHUB_ENV | |
echo SYMENGINE_LOCATION=/Users/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV | |
echo LCMTYPES_SYM_LOCATION=/Users/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/sym/__init__.py >> $GITHUB_ENV | |
echo LCMTYPES_EIGEN_LCM_LOCATION=/Users/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/eigen_lcm/__init__.py >> $GITHUB_ENV | |
echo SF_SYMPY_LOCATION=/Users/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV | |
- name: Test everything is installed in expected locations | |
run: ./.github/scripts/expected_paths_test.py |