[pre-commit.ci] pre-commit autoupdate #102
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: Pixi Packaging and Deployment | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| env: | |
| PKG_NAME: finddata | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Pixi | |
| uses: prefix-dev/[email protected] | |
| - name: finddata version | |
| run: | | |
| pixi run finddata --version | |
| - name: Dependency check | |
| run: | | |
| pixi run audit-deps | |
| - name: Test imports | |
| run: | | |
| # Test that finddata can be imported with plot_publisher available (conda package scenario) | |
| pixi run python -c "import finddata; print('finddata imported successfully with plot_publisher')" | |
| # Test that plotting functions are available | |
| pixi run python -c "import finddata; assert hasattr(finddata, 'publish_plot'); assert hasattr(finddata, 'plot1d'); assert hasattr(finddata, 'plot_heatmap'); print('All plotting functions available')" | |
| # Test basic functionality | |
| pixi run finddata --version | |
| #- name: build pypi package | |
| # run: | | |
| # pixi run build-pypi | |
| rpm: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup pixi | |
| uses: prefix-dev/[email protected] | |
| - name: Build sdist | |
| run: pixi run build-sdist | |
| - name: Build RPM inside of docker | |
| run: | | |
| docker build --tag rpmbuilder -f Dockerfile . | |
| docker run -t rpmbuilder finddata --version | |
| package: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Pixi | |
| uses: prefix-dev/[email protected] | |
| - name: Build Conda package | |
| run: | | |
| pixi run build-conda | |
| mkdir -p /tmp/local-channel/linux-64 | |
| cp *.conda /tmp/local-channel/linux-64 | |
| - name: Verify conda package | |
| uses: neutrons/conda-verify@main | |
| with: | |
| package-name: finddata | |
| local-channel: /tmp/local-channel | |
| extra-channels: mantid-ornl neutrons/label/rc neutrons | |
| extra-commands: pixi run python -c "import finddata" | |
| - name: Upload conda package as artifact | |
| uses: actions/upload-artifact@v4 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| name: artifact-conda-package | |
| path: ${{ env.PKG_NAME }}-*.conda | |
| publish: | |
| runs-on: ubuntu-24.04 | |
| needs: [tests, package, rpm] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Pixi | |
| uses: prefix-dev/[email protected] | |
| with: | |
| pixi-version: v0.49.0 | |
| - name: Download conda package artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: artifact-conda-package | |
| - name: Upload package to anaconda | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
| IS_RC: ${{ contains(github.ref, 'rc') }} | |
| run: | | |
| # label is main or rc depending on the tag-name | |
| CONDA_LABEL="main" | |
| if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi | |
| echo pushing ${{ github.ref }} with label $CONDA_LABEL | |
| pixi run anaconda upload --label $CONDA_LABEL --user neutrons ${{ env.PKG_NAME }}-*.conda |