Update orientation viewer #1028
Workflow file for this run
This file contains hidden or 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 | |
| on: [push, pull_request] | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| ruff: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/ruff-action@v3 | |
| with: | |
| args: "check --fix-only --exit-non-zero-on-fix" | |
| - uses: pre-commit-ci/lite-action@v1.1.0 | |
| if: always() | |
| with: | |
| msg: '[pre-commit.ci lite] apply automatic fixes for ruff linting errors' | |
| test: | |
| needs: [ruff] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| python-version: ["3.10", "3.11", "3.12"] | |
| fail-fast: false | |
| env: | |
| BUILD_WHEEL: ${{ (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12') && 'true' || '' }} | |
| steps: | |
| - name: Obtain sasmodels source from git | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: | | |
| **/requirements*.txt | |
| # If actions have problems with disk-space this can be re-enabled | |
| # (The reports always show many GB in free space and it takes minutes to run) | |
| # - name: Free Disk Space (Ubuntu) | |
| # if: ${{ matrix.os == 'ubuntu-latest' }} | |
| # uses: jlumbroso/free-disk-space@main | |
| # with: | |
| # haskell: false | |
| # large-packages: false | |
| ### Build sasmodels | |
| - name: Build sasmodels | |
| if: env.BUILD_WHEEL | |
| run: | | |
| python -m pip install build hatchling | |
| python -m build --sdist --wheel | |
| python -m pip install dist/sasmodels*whl | |
| - name: Publish sdist and wheel package | |
| if: env.BUILD_WHEEL | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sasmodels-${{ matrix.os }}-${{ matrix.python-version }} | |
| path: | | |
| dist/sasmodels*whl | |
| dist/sasmodels*tar* | |
| if-no-files-found: ignore | |
| ### Publish documentation | |
| - name: Publish sasmodels docs | |
| if: env.BUILD_WHEEL | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sasmodels-docs-${{ matrix.os }}-${{ matrix.python-version }} | |
| path: | | |
| build/doc/ | |
| if-no-files-found: error | |
| ### Install dependencies | |
| - name: Install Python dependencies (tests) | |
| run: | | |
| python -m pip install -r build_tools/requirements.txt -r build_tools/requirements-test.txt -r build_tools/requirements-opencl.txt | |
| ### Build and test sasmodels | |
| - name: Test with pytest | |
| env: | |
| PYOPENCL_COMPILER_OUTPUT: 1 | |
| SAS_OPENCL: none | |
| run: | | |
| pytest -v | |