|
| 1 | +name: test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + - cron: '8 15 * * 0' # 8:15 every Monday |
| 8 | + |
| 9 | +jobs: |
| 10 | + build_and_test_plugin: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + os: [ ubuntu-latest, macos-latest, windows-latest ] |
| 14 | + |
| 15 | + name: ${{ matrix.os }} |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + path: src |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + run: pip install 'ncrystal-core>=3.9.86' "scikit-build-core>=0.10" "ncrystal-pypluginmgr>=0.0.3" "ncrystal-python>=3.9.86" |
| 26 | + |
| 27 | + - name: Install plugin |
| 28 | + run: pip install ./src |
| 29 | + |
| 30 | + - name: Verify plugin loading |
| 31 | + shell: python |
| 32 | + run: | |
| 33 | + import os |
| 34 | + os.environ['NCRYSTAL_PLUGIN_RUNTESTS'] = '1' |
| 35 | + os.environ['NCRYSTAL_REQUIRED_PLUGINS'] = 'CrysText' |
| 36 | + import NCrystal |
| 37 | + NCrystal.browsePlugins(dump=True) |
| 38 | +
|
| 39 | + - name: Use plugin file |
| 40 | + run: nctool -d 'plugins::CrysText/Al_sg225.ncmat' |
| 41 | + |
| 42 | + - name: Load all plugin files |
| 43 | + shell: python |
| 44 | + run: | |
| 45 | + from NCrystal.datasrc import browseFiles |
| 46 | + from NCrystal.core import createScatter |
| 47 | + for f in browseFiles(factory='plugins'): |
| 48 | + if f.name.startswith('CrysText/'): |
| 49 | + print('Loading f.fullKey') |
| 50 | + createScatter( f'{f.fullKey}' |
| 51 | + ";dir1=@crys_hkl:0,1,0@lab:0,1,0" |
| 52 | + ";dir2=@crys_hkl:1,0,0@lab:1,0,0" |
| 53 | + ";mos=0.1deg;dirtol=180deg" ) |
0 commit comments