test: introduce end-to-end app test #1
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: End-to-End Test | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| new-release-detected: | ||
| required: true | ||
| type: string | ||
| distribution-artifacts-name: | ||
| required: true | ||
| type: string | ||
| distribution-artifacts-dir: | ||
| required: true | ||
| type: string | ||
| package-name: | ||
| required: true | ||
| type: string | ||
| distribution-file-incipit: | ||
| required: true | ||
| type: string | ||
| test-dependency-group: | ||
| required: true | ||
| type: string | ||
| run-test-command: | ||
| required: true | ||
| type: string | ||
| jobs: | ||
| test-e2e: | ||
| name: End-to-End Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - !step | ||
| name: Setup | Checkout Repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| ref: ${{ github.sha }} | ||
| fetch-depth: 1 | ||
| - !step | ||
| name: Setup | Download Distribution Artifacts | ||
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | ||
| if: ${{ inputs.new-release-detected == 'true' }} | ||
| id: artifact-download | ||
| with: | ||
| name: ${{ inputs.distribution-artifacts-name }} | ||
| path: ${{ inputs.distribution-artifacts-dir }} | ||
| - !step | ||
| name: Setup | Install Python | ||
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||
| with: | ||
| python-version-file: .python-version | ||
| - !step | ||
| name: Setup | Install uv | ||
| uses: astral-sh/setup-uv@eb1897b8dc4b5d5bfe39a428a8f2304605e0983c # v7.0.0 | ||
| - name: Setup | Install Project Dependencies for Test | ||
| env: | ||
| UV_NO_MANAGED_PYTHON: true | ||
| run: uv sync --group ${{ inputs.test-dependency-group }} | ||
| - name: Setup | Install distribution artifact | ||
| if: ${{ steps.artifact-download.outcome == 'success' }} | ||
| run: | | ||
| uv pip uninstall ${{ inputs.package-name }} | ||
| uv pip install ${{ inputs.distribution-artifacts-dir}}/${{ inputs.distribution-file-incipit }}-*.whl | ||
| - name: Test | Run pytest | ||
| run: ${{ inputs.run-test-command }} | ||
| - name: Test | Run End-to-End App Test | ||
| run: ./tests/e2e_test_app.py | ||
| - name: Test | Check End-to-End Test Results | ||
| run: [ "$(wc -l < e2e-test-app-stderr.log)" -eq 3 ] && [ "$(wc -l < e2e-test-logfile.log)" -eq 3 ] && [ ! -s "e2e-test-logfile_root.log" ] | ||