AlphaX cross-projects tests #48
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: AlphaX cross-projects tests | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| alphabase_ref: | |
| description: "alphabase version: version of alphabase to use. Can be branch name, commit hash, or 'latest' for the latest release. If the default is 'skip', the project will be skipped unless a version is given." | |
| default: main | |
| alphabase_extra: | |
| description: "alphabase installation extra (e.g. 'full' or '')" | |
| default: full | |
| alphatims_ref: | |
| description: "alphatims version" | |
| default: main | |
| alpharaw_ref: | |
| description: "alpharaw version" | |
| default: main | |
| alphaviz_ref: | |
| description: "alphaviz version" | |
| default: skip | |
| alphamap_ref: | |
| description: "alphamap version" | |
| default: skip | |
| alphapeptdeep_ref: | |
| description: "alphapeptdeep version" | |
| default: main | |
| alphapepttools_ref: | |
| description: "alphapepttools version" | |
| default: skip | |
| alphapepttools_extra: | |
| description: "alphapepttools installation extra (e.g. 'full' or '')" | |
| default: full | |
| directlfq_ref: | |
| description: "directlfq version" | |
| default: main | |
| alphadia_ref: | |
| description: "alphadia version" | |
| default: main | |
| jobs: | |
| build_image: | |
| runs-on: AlphaDIA | |
| steps: | |
| - name: Print input parameters | |
| run: echo "${{ toJSON(github.event.inputs) }}" | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | |
| # # avoid "no space left on device" error | |
| # # https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | |
| # - name: cleanup | |
| # run: | | |
| # sudo rm -rf /usr/share/dotnet | |
| # sudo rm -rf /opt/ghc | |
| # sudo rm -rf "/usr/local/share/boost" | |
| # sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| - name: Build and export | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # 6.15.0 | |
| with: | |
| tags: alphax:latest | |
| context: ./alphatesting | |
| outputs: type=docker,dest=/tmp/alphax.tar | |
| # cache-from: type=gha | |
| # cache-to: type=gha,mode=max | |
| no-cache: True | |
| build-args: | | |
| ALPHABASE_REF=${{ inputs.alphabase_ref }} | |
| ALPHABASE_EXTRA=${{ inputs.alphabase_extra }} | |
| ALPHATIMS_REF=${{ inputs.alphatims_ref }} | |
| ALPHARAW_REF=${{ inputs.alpharaw_ref }} | |
| ALPHAVIZ_REF=${{ inputs.alphaviz_ref }} | |
| ALPHAMAP_REF=${{ inputs.alphamap_ref }} | |
| ALPHAPEPTDEEP_REF=${{ inputs.alphapeptdeep_ref }} | |
| ALPHAPEPTTOOLS_REF=${{ inputs.alphapepttools_ref }} | |
| ALPHAPEPTTOOLS_EXTRA=${{ inputs.alphapepttools_extra }} | |
| DIRECTLFQ_REF=${{ inputs.directlfq_ref }} | |
| ALPHADIA_REF=${{ inputs.alphadia_ref }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: alphax | |
| path: /tmp/alphax.tar | |
| - name: get requirements | |
| run: | | |
| docker load --input /tmp/alphax.tar | |
| TARGET_FOLDER=${{ github.workspace }}/requirements | |
| mkdir -p $TARGET_FOLDER | |
| docker run -v $TARGET_FOLDER:/app/data alphax bash -c "cp /app/requirements*.txt /app/data" | |
| cd $TARGET_FOLDER | |
| zip requirements.zip requirements*.txt | |
| - name: upload requirements | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: requirements.zip | |
| path: ${{ github.workspace }}/requirements/requirements.zip | |
| if-no-files-found: warn | |
| alphabase_tests: | |
| if: ${{ inputs.alphabase_ref != 'skip' }} | |
| runs-on: AlphaDIA | |
| needs: [ build_image ] | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: alphax | |
| path: /tmp | |
| - name: Load image | |
| run: | | |
| docker load --input /tmp/alphax.tar | |
| docker image ls -a | |
| - name: Print pip freeze | |
| run: | | |
| docker run alphax bash -c "pip freeze" | |
| - name: alphabase tests | |
| id: alphabase_tests | |
| run: | | |
| docker run alphax bash -c "cd alphabase/tests && chmod +x run_tests.sh && ./run_tests.sh" | |
| alpharaw_tests: | |
| if: ${{ inputs.alpharaw_ref != 'skip' }} | |
| runs-on: AlphaDIA | |
| needs: [ build_image ] | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: alphax | |
| path: /tmp | |
| - name: Load image | |
| run: | | |
| docker load --input /tmp/alphax.tar | |
| docker image ls -a | |
| - name: Print pip freeze | |
| run: | | |
| docker run alphax bash -c "pip freeze" | |
| - name: alpharaw tests | |
| id: alpharaw_tests | |
| run: | | |
| docker run alphax bash -c "cd alpharaw/alpharaw && ls && cat ms_data_base.py || exit 0" | |
| docker run alphax bash -c "cd alpharaw/tests && ls && python -m download_test_data && chmod +x run_tests.sh && ./run_tests.sh" | |
| alphaviz_tests: | |
| if: ${{ inputs.alphaviz_ref != 'skip' }} | |
| runs-on: AlphaDIA | |
| needs: [ build_image ] | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: alphax | |
| path: /tmp | |
| - name: Load image | |
| run: | | |
| docker load --input /tmp/alphax.tar | |
| docker image ls -a | |
| - name: Print pip freeze | |
| run: | | |
| docker run alphax bash -c "pip freeze" | |
| - name: alphaviz tests | |
| id: alphaviz_tests | |
| run: | | |
| docker run alphax bash -c "cd alphaviz/tests && ls && python -m pytest test_io.py && python -m pytest test_preprocessing.py" | |
| # currently no tests in alphamap | |
| alphapeptdeep_tests: | |
| if: ${{ inputs.alphapeptdeep_ref != 'skip' }} | |
| runs-on: AlphaDIA | |
| needs: [ build_image ] | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: alphax | |
| path: /tmp | |
| - name: Load image | |
| run: | | |
| docker load --input /tmp/alphax.tar | |
| docker image ls -a | |
| - name: Print pip freeze | |
| run: | | |
| docker run alphax bash -c "pip freeze" | |
| - name: alphapeptdeep tests | |
| id: alphapeptdeep_tests | |
| run: | | |
| docker run alphax bash -c "cd alphapeptdeep/tests && chmod +x run_tests.sh && ./run_tests.sh" | |
| alphapepttools_tests: | |
| if: ${{ inputs.alphapepttools_ref != 'skip' }} | |
| runs-on: AlphaDIA | |
| needs: [ build_image ] | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: alphax | |
| path: /tmp | |
| - name: Load image | |
| run: | | |
| docker load --input /tmp/alphax.tar | |
| docker image ls -a | |
| - name: Print pip freeze | |
| run: | | |
| docker run alphax bash -c "pip freeze" | |
| - name: alphapepttools tests | |
| id: alphapepttools_tests | |
| run: | | |
| docker run alphax bash -c "cd alphapepttools/tests && python -m pytest && ./run_notebook_tests.sh" | |
| alphadia_tests: | |
| if: ${{ inputs.alphadia_ref != 'skip' }} | |
| runs-on: AlphaDIA | |
| needs: [ build_image ] | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: alphax | |
| path: /tmp | |
| - name: Load image | |
| run: | | |
| docker load --input /tmp/alphax.tar | |
| docker image ls -a | |
| - name: Print pip freeze | |
| run: | | |
| docker run alphax bash -c "pip freeze" | |
| - name: alphadia unit tests | |
| id: alphadia_unit_tests | |
| run: | | |
| docker run alphax bash -c "cd alphadia/tests && python -m pytest unit_tests" | |
| - name: alphadia unit tests ('slow') | |
| id: alphadia_slow_unit_tests | |
| run: | | |
| docker run alphax bash -c "cd alphadia/tests && python -m pytest integration_tests" | |
| - name: alphadia e2e test 'synchropasef' | |
| id: alphadia_e2e_tests | |
| run: | | |
| TEST_CASE_NAME=synchropasef | |
| docker run alphax bash -c "cd alphadia/tests/e2e_tests \ | |
| && python prepare_test_data.py $TEST_CASE_NAME \ | |
| && alphadia --config $TEST_CASE_NAME/config.yaml" |