add back dev deploy trigger #20
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: Tests, Package, and Deployment | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: [next, qa, main] | |
| tags: ["v*"] | |
| # cancel previous job if new commit is pushed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PKG_NAME: pyrs | |
| MODULE_NAME: pyrs | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: prefix-dev/setup-pixi@v0.9.4 | |
| with: | |
| manifest-path: pyproject.toml | |
| - name: Apt install deps | |
| run: | | |
| sudo apt update | |
| sudo apt-get install xvfb freeglut3-dev libglu1-mesa | |
| - name: Start xvfb daemon | |
| run: | | |
| /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile \ | |
| --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 | |
| - name: Mantid pre-requisites - create a properties file that turns off network access | |
| run: | | |
| mkdir ~/.mantid | |
| echo "CheckMantidVersion.OnStartup=0" > ~/.mantid/Mantid.user.properties | |
| echo "UpdateInstrumentDefinitions.OnStartup=0" >> ~/.mantid/Mantid.user.properties | |
| echo "usagereports.enabled=0" >> ~/.mantid/Mantid.user.properties | |
| - name: Test framework imports | |
| run: pixi run test-import-framework | |
| - name: run unit tests | |
| run: | | |
| echo "running unit tests" | |
| xvfb-run --server-args="-screen 0 1280x1024x16" -a pixi run test | |
| - name: List coverage files (debug) | |
| run: | | |
| echo "Coverage files generated:" | |
| ls -la coverage.xml || echo "No coverage.xml found" | |
| ls -la .coverage || echo "No .coverage found" | |
| - name: upload coverage to codecov | |
| uses: codecov/codecov-action@v5 | |
| if: github.actor != 'dependabot[bot]' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: Dependency check | |
| run: | | |
| pixi run audit-deps | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: prefix-dev/setup-pixi@v0.9.4 | |
| with: | |
| manifest-path: pyproject.toml | |
| - name: mypy | |
| run: pixi run mypy pyrs scripts tests | |
| conda-build: | |
| name: Build conda package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup pixi | |
| uses: prefix-dev/setup-pixi@v0.9.4 | |
| with: | |
| pixi-version: v0.62.2 | |
| manifest-path: pyproject.toml | |
| # Workaround: Dynamic versioning (versioningit) causes lock file version mismatch. | |
| # We skip the editable package install and do it separately with pip. | |
| # See: https://github.com/prefix-dev/pixi/pull/3092 | |
| run-install: false | |
| - name: Install dependencies (skip local package) | |
| run: pixi install --frozen --skip ${{ env.PKG_NAME }} | |
| - name: Install local package | |
| run: pixi run pip install --no-deps -e . | |
| - 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-actions/pkg-verify@main | |
| with: | |
| package-name: ${{ env.PKG_NAME }} | |
| module-name: ${{ env.MODULE_NAME }} | |
| local-channel: /tmp/local-channel | |
| python-version: 3.11 | |
| extra-channels: conda-forge mantid | |
| - name: Upload conda package as artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: artifact-conda-package | |
| path: ${{ env.PKG_NAME }}-*.conda | |
| publish: | |
| name: Upload package to anaconda | |
| runs-on: ubuntu-latest | |
| needs: [lint, tests, conda-build] | |
| if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/next' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.4 | |
| with: | |
| pixi-version: v0.62.2 | |
| manifest-path: pyproject.toml | |
| # Workaround: Dynamic versioning (versioningit) causes lock file version mismatch. | |
| # We skip the editable package install and do it separately with pip. | |
| # See: https://github.com/prefix-dev/pixi/pull/3092 | |
| run-install: false | |
| - name: Install dependencies (skip local package) | |
| run: pixi install --frozen --skip ${{ env.PKG_NAME }} | |
| - name: Download conda package artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: artifact-conda-package | |
| - name: Upload package to anaconda | |
| uses: neutrons/conda-actions/publish@main | |
| with: | |
| anaconda-token: ${{ secrets.ANACONDA_TOKEN }} | |
| organization: neutrons | |
| package-path: ${{ env.PKG_NAME }}-*.conda | |
| - name: Remove old packages | |
| if: github.ref == 'refs/heads/next' | |
| uses: neutrons/conda-actions/pkg-remove@v1 | |
| with: | |
| anaconda_token: ${{ secrets.ANACONDA_TOKEN }} | |
| organization: neutrons | |
| package_name: ${{ env.PKG_NAME }} | |
| label: ${{ env.CONDA_LABEL }} | |
| keep: 5 | |
| deploy-dev: | |
| runs-on: ubuntu-latest | |
| needs: publish | |
| 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: 18073 | |
| 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 }} |