|
| 1 | +name: Test source |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + bundle-key: |
| 7 | + description: "Key needed to access bundle of artifacts" |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + build-target: |
| 11 | + description: "Target name as defined by inputs.sh" |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + container-path: |
| 15 | + description: "Path to built container at registry" |
| 16 | + required: true |
| 17 | + type: string |
| 18 | + |
| 19 | +env: |
| 20 | + INTEGRATION_TESTS_ARGS: "--extended --exclude feature_pruning,feature_dbcrash" |
| 21 | + |
| 22 | +jobs: |
| 23 | + test-src: |
| 24 | + name: Test source |
| 25 | + runs-on: ubuntu-24.04 |
| 26 | + container: |
| 27 | + image: ${{ inputs.container-path }} |
| 28 | + options: --user root |
| 29 | + steps: |
| 30 | + - name: Checkout code |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + ref: ${{ github.event.pull_request.head.sha }} |
| 34 | + fetch-depth: 1 |
| 35 | + |
| 36 | + - name: Download build artifacts |
| 37 | + uses: actions/download-artifact@v4 |
| 38 | + with: |
| 39 | + name: ${{ inputs.bundle-key }} |
| 40 | + |
| 41 | + - name: Manage releases cache |
| 42 | + uses: actions/cache@v4 |
| 43 | + if: inputs.build-target == 'linux64' |
| 44 | + with: |
| 45 | + path: | |
| 46 | + releases |
| 47 | + key: releases-${{ hashFiles('ci/test/00_setup_env_native_qt5.sh', 'test/get_previous_releases.py') }} |
| 48 | + |
| 49 | + - name: Run functional tests |
| 50 | + id: test |
| 51 | + run: | |
| 52 | + git config --global --add safe.directory "$PWD" |
| 53 | + export BUILD_TARGET="${{ inputs.build-target }}" |
| 54 | + export BUNDLE_KEY="${{ inputs.bundle-key }}" |
| 55 | + ./ci/dash/bundle-artifacts.sh extract |
| 56 | + ./ci/dash/slim-workspace.sh |
| 57 | + source ./ci/dash/matrix.sh |
| 58 | + ./ci/dash/test_integrationtests.sh ${INTEGRATION_TESTS_ARGS} |
| 59 | + shell: bash |
| 60 | + |
| 61 | + - name: Bundle test logs |
| 62 | + id: bundle |
| 63 | + if: success() || (failure() && steps.test.outcome == 'failure') |
| 64 | + run: | |
| 65 | + export BUILD_TARGET="${{ inputs.build-target }}" |
| 66 | + echo "short-sha=$(git rev-parse --short=8 HEAD)" >> "${GITHUB_OUTPUT}" |
| 67 | + ( [ -d "testlogs" ] && echo "upload-logs=true" >> "${GITHUB_OUTPUT}" && ./ci/dash/bundle-logs.sh ) \ |
| 68 | + || echo "upload-logs=false" >> "${GITHUB_OUTPUT}" |
| 69 | + shell: bash |
| 70 | + |
| 71 | + - name: Upload test logs |
| 72 | + uses: actions/upload-artifact@v4 |
| 73 | + if: | |
| 74 | + success() || (failure() && steps.test.outcome == 'failure') |
| 75 | + && steps.bundle.outputs.upload-logs == 'true' |
| 76 | + with: |
| 77 | + name: test_logs-${{ inputs.build-target }}-${{ steps.bundle.outputs.short-sha }} |
| 78 | + path: | |
| 79 | + test_logs-${{ inputs.build-target }}.tar.zst |
| 80 | + test_logs-${{ inputs.build-target }}.tar.zst.sha256 |
| 81 | + compression-level: 0 |
| 82 | + overwrite: true |
| 83 | + retention-days: 1 |
0 commit comments