Skip to content

Add scalar constructors for Segment3d and document 2D convention #402

Add scalar constructors for Segment3d and document 2D convention

Add scalar constructors for Segment3d and document 2D convention #402

Workflow file for this run

name: nouse_install
on:
push:
pull_request:
types: [opened, reopened, synchronize]
schedule:
- cron: '34 17 * * *'
concurrency:
# Key each master push on its commit SHA so every merge lands in its own
# concurrency group. Sharing one group serializes master runs, and with
# cancel-in-progress disabled GitHub still cancels a pending run when the
# next merge queues behind the one in progress, so a later merge would
# drop an earlier merge's result. A unique group per SHA keeps every
# master run independent. Pull requests key on the PR number and other
# branches on the ref, so their superseded runs still cancel.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.ref == 'refs/heads/master' && github.sha) || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
check_skip:
# A fork inherits no SCGH_NIGHTLY, so this gate stops the nightly cron
# from allocating a runner there.
if: github.event_name != 'schedule' || (vars.SCGH_NIGHTLY || vars.MMGH_NIGHTLY) == 'enable'
uses: ./.github/workflows/check_skip_ci.yml
permissions:
contents: read
pull-requests: read
issues: read
nouse_install:
needs: [check_skip]
# The setup.py install path re-verifies packaging and duplicates the build
# job's pytest. It does not gate correctness on a pull request, so it runs
# on the nightly schedule and on release tag pushes only, not on pull
# requests or master pushes. Set the SCGH_FORCE_NOUSE_INSTALL variable to
# 'enable' to force it on a fork.
if: |
needs.check_skip.outputs.skip != 'true' && (
(github.event_name == 'schedule' && (vars.SCGH_NIGHTLY || vars.MMGH_NIGHTLY) == 'enable') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
(vars.SCGH_FORCE_NOUSE_INSTALL || vars.MMGH_FORCE_NOUSE_INSTALL) == 'enable')
name: nouse_install_${{ matrix.os }}_Release
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ fromJSON(vars.SCGH_TIMEOUT_NOUSE_INSTALL || vars.MMGH_TIMEOUT_NOUSE_INSTALL || '30') }}
env:
JOB_CMAKE_ARGS: -DBUILD_QT=OFF -DUSE_CLANG_TIDY=OFF -DCMAKE_BUILD_TYPE=Release
strategy:
matrix:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-26-Readme.md
os: [ubuntu-24.04, macos-26]
fail-fast: false
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: event name
run: |
echo "github.event_name: ${{ github.event_name }}"
- name: setup dependencies for Linux
if: runner.os == 'Linux'
uses: ./.github/actions/setup_linux
with:
workflow: 'nouse_install'
- name: setup dependencies for MacOS
if: runner.os == 'MacOS'
uses: ./.github/actions/setup_macos
with:
workflow: 'nouse_install'
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.23
with:
# This job builds `BUILD_QT=OFF` under the `setup.py` build
# directory, so its objects match neither the flags nor the paths
# that the `build` job stores under the plain `<os>-Release` key.
# Sharing that key only restores a cache it cannot hit.
key: ${{ runner.os }}-nouse-Release
restore-keys: ${{ runner.os }}-nouse-Release
save: ${{ github.event_name != 'pull_request' }}
# Bound the cache so it does not grow without limit across the rolling
# key. A master push or nightly run saves this cache; pull requests
# restore it (a PR on a non-default base branch cannot, so it runs
# cold).
max-size: 1500M
- name: setup.py install build_ext
run: |
echo "::group::setup.py install build_ext"
SUDO_CMD=""
if [ ${{ matrix.os }} == "ubuntu-24.04" ] ; then
SUDO_CMD="sudo"
fi
$SUDO_CMD python3 setup.py install build_ext \
--cmake-args="${JOB_CMAKE_ARGS} -DPYTHON_EXECUTABLE=$(which python3) -Dpybind11_ROOT=${pybind11_ROOT}" \
--make-args="VERBOSE=1"
echo "::endgroup::"
- name: pytest
run: |
echo "::group::pytest"
rm -rf tmp/
mkdir -p tmp/
cp -a tests tmp/
cd tmp/
python3 -c 'import os; print(os.getcwd())'
python3 -c "import solvcon; print(solvcon.__file__)"
python3 -c "import _solvcon; print(_solvcon.__file__)"
# The following command is the original commend, and it will fail on pytest == 8.0.0 .
# pytest --rootdir=/tmp -v
# Here is the issue and temporary solution: https://github.com/pytest-dev/pytest/issues/11781
# The alternative command to solve the issue is ```pytest --rootdir=. -v```.
pytest --rootdir=. -v
cd ..
echo "::endgroup::"
send_email_on_failure:
needs: [nouse_install]
# Run if any of the dependencies failed in master branch. A
# `timeout-minutes` kill reports `cancelled`, not `failure`.
if: |
always() &&
(contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')) &&
github.ref_name == 'master' &&
github.event.repository.fork == false
uses: ./.github/workflows/send_email_on_fail.yml
with:
job_results: |
- nouse_install: ${{ needs.nouse_install.result }}
secrets:
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}