Bump prefix-dev/setup-pixi from 0.9.3 to 0.9.4 #93
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: Tests, Package, and Deployment | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: [next] | |
| tags: ["v*"] | |
| # cancel previous job if new commit is pushed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PKG_NAME: hyspecppt | |
| jobs: | |
| tests: | |
| name: Testing Suite | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.4 | |
| - name: Install hyspecppt | |
| run: pixi run python -m pip install -e . | |
| - name: Run tests | |
| run: pixi run xvfb-run --server-args="-screen 0 1920x1080x24" -a python -m pytest --cov=src --cov-report=xml --cov-report=term | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| build: | |
| name: Conda build with Pixi | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 100 | |
| fetch-tags: true | |
| ref: ${{ github.ref }} | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.4 | |
| - name: Build Conda package | |
| run: pixi run conda-build | |
| - name: upload conda package as artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: artifact-conda-package | |
| path: ${{ env.PKG_NAME }}-*.conda | |
| conda-verify: | |
| name: Conda Verify | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| ref: ${{ github.ref }} | |
| - name: Setup micromamba | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-name: test | |
| init-shell: bash | |
| create-args: >- | |
| python=3.10 | |
| - name: Download conda package artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: artifact-conda-package | |
| path: /tmp/local-channel/linux-64 | |
| - name: Install the package | |
| run: | | |
| micromamba install --yes -c conda-forge conda-build conda-index | |
| python -m conda_index /tmp/local-channel | |
| micromamba install -c /tmp/local-channel -c conda-forge ${{ env.PKG_NAME }} | |
| - name: Verify the installation | |
| env: | |
| MPLBACKEND: Agg | |
| run: | | |
| conda_version=$(micromamba list "${{ env.PKG_NAME }}" | awk -v pkg="${{ env.PKG_NAME }}" '$1 == pkg { print $2 }') | |
| echo "Conda version: $conda_version" | |
| python_version=$(python -c "import ${{ env.PKG_NAME }}; print(${{ env.PKG_NAME }}.__version__)") | |
| echo "Python version: $python_version" | |
| if [ "$conda_version" != "$python_version" ]; then | |
| echo "Version mismatch!" | |
| exit 1 | |
| else | |
| echo "Versions match." | |
| fi | |
| publish: | |
| name: Publish | |
| runs-on: ubuntu-24.04 | |
| needs: [tests, conda-verify] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 100 | |
| fetch-tags: true | |
| ref: ${{ github.ref }} | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.4 | |
| - name: Download previous conda package artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: artifact-conda-package | |
| - name: Get artifact conda package filename | |
| run: | | |
| echo "Files downloaded:" | |
| ls | |
| # Get the first file | |
| FILE_NAME=$(ls ./${{ env.PKG_NAME }}-*.conda) | |
| echo "Conda package file to publish: $FILE_NAME" | |
| - 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 | |
| # Trigger GitLab dev deploy pipeline | |
| deploy-dev: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| # if: github.ref == 'refs/heads/next' | |
| steps: | |
| - name: Get Environment Name | |
| uses: neutrons/branch-mapper@main | |
| id: env_name | |
| with: | |
| prefix: ${{ env.PKG_NAME }} | |
| - name: Trigger Dev Deploy | |
| # use https://github.com/eic/trigger-gitlab-ci/pull/14 until merged | |
| uses: eic/trigger-gitlab-ci@d984d8d53d871d2fdc1325639d94322da6e8747f | |
| id: trigger | |
| with: | |
| url: https://code.ornl.gov | |
| project_id: 18005 | |
| ref_name: main | |
| token: ${{ secrets.GITLAB_DEPLOY_TOKEN }} | |
| - name: Annotate commit | |
| uses: peter-evans/commit-comment@v4 | |
| with: | |
| body: | | |
| GitLab pipeline for ${{ steps.env_name.outputs.name }} has been submitted for this commit: ${{ steps.trigger.outputs.web_url }} |