diff --git a/.github/workflows/base-windows.yml b/.github/workflows/base-windows.yml index c770a90f1944..15a394427b0a 100644 --- a/.github/workflows/base-windows.yml +++ b/.github/workflows/base-windows.yml @@ -82,7 +82,6 @@ env: PYTHONIOENCODING: utf-8 QUARKUS_PATH: ${{ github.workspace }}\quarkus MANDREL_PACKAGING_REPO: ${{ github.workspace }}\mandrel-packaging - COLLECTOR_URL: https://collector.foci.life/api/v1/image-stats jobs: build-vars: @@ -533,36 +532,17 @@ jobs: native-tests-stats-upload: name: Upload build stats to collector - if: always() && inputs.build-stats-tag != 'null' && github.event_name != 'pull_request' + if: always() && inputs.build-stats-tag != 'null' && github.event_name != 'pull_request' && needs.native-tests.result != 'skipped' && needs.native-tests.result != 'cancelled' needs: - native-tests - get-test-matrix strategy: - fail-fast: false matrix: ${{ fromJson(needs.get-test-matrix.outputs.tests-matrix) }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - if: startsWith(matrix.os-name, 'windows') - with: - repository: graalvm/mandrel - fetch-depth: 1 - path: workflow-mandrel - - uses: actions/download-artifact@v4 - if: startsWith(matrix.os-name, 'windows') - with: - name: build-stats-${{matrix.category}}-${{ needs.get-test-matrix.outputs.artifacts-suffix }} - path: . - - name: Extract and import build stats - if: startsWith(matrix.os-name, 'windows') - env: - UPLOAD_TOKEN: ${{ secrets.UPLOAD_COLLECTOR_TOKEN }} - shell: bash - run: | - tar -xf build-stats.tgz - export BUILD_STATS_TAG="$(echo ${{ inputs.build-stats-tag }})" - echo "Tag for stat upload is going to be: '${BUILD_STATS_TAG}'" - DIR=quarkus/ TAG="${BUILD_STATS_TAG}" TOKEN="${UPLOAD_TOKEN}" URL="${COLLECTOR_URL}" bash workflow-mandrel/.github/import_stats.sh + uses: ./.github/workflows/native-tests-stats-upload.yml + with: + artifacts-suffix: ${{ needs.get-test-matrix.outputs.artifacts-suffix }} + build-stats-tag: ${{ inputs.build-stats-tag }} + category: ${{ matrix.category }} mandrel-integration-tests: name: Q Mandrel IT diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 66e5d84d50ca..39bd0b13c9b8 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -82,7 +82,6 @@ env: QUARKUS_PATH: ${{ github.workspace }}/quarkus MANDREL_IT_PATH: ${{ github.workspace }}/mandrel-integration-tests MANDREL_PACKAGING_REPO: ${{ github.workspace }}/mandrel-packaging - COLLECTOR_URL: https://collector.foci.life/api/v1/image-stats jobs: build-vars: @@ -628,28 +627,12 @@ jobs: - native-tests - get-test-matrix strategy: - fail-fast: false matrix: ${{ fromJson(needs.get-test-matrix.outputs.tests-matrix) }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - repository: graalvm/mandrel - fetch-depth: 1 - path: workflow-mandrel - - uses: actions/download-artifact@v4 - with: - name: build-stats-${{matrix.category}}-${{ needs.get-test-matrix.outputs.artifacts-suffix }} - path: . - - name: Extract and import build stats - env: - UPLOAD_TOKEN: ${{ secrets.UPLOAD_COLLECTOR_TOKEN }} - shell: bash - run: | - tar -xf build-stats.tgz - export BUILD_STATS_TAG="$(echo ${{ inputs.build-stats-tag }})" - echo "Tag for stat upload is going to be: '${BUILD_STATS_TAG}'" - DIR=quarkus/ TAG="${BUILD_STATS_TAG}" TOKEN="${UPLOAD_TOKEN}" URL="${COLLECTOR_URL}" bash workflow-mandrel/.github/import_stats.sh + uses: ./.github/workflows/native-tests-stats-upload.yml + with: + artifacts-suffix: ${{ needs.get-test-matrix.outputs.artifacts-suffix }} + build-stats-tag: ${{ inputs.build-stats-tag }} + category: ${{ matrix.category }} mandrel-integration-tests: name: Q Mandrel IT diff --git a/.github/workflows/native-tests-stats-upload.yml b/.github/workflows/native-tests-stats-upload.yml new file mode 100644 index 000000000000..54291b5bf7f4 --- /dev/null +++ b/.github/workflows/native-tests-stats-upload.yml @@ -0,0 +1,46 @@ +name: Native tests stats upload + +on: + workflow_call: + inputs: + artifacts-suffix: + type: string + description: 'The stats artifact suffix to download' + default: "null" + build-stats-tag: + type: string + description: 'The tag to use for build stats upload of native tests (e.g. 22.3.0-dev-jdk17-mytest-patch-before)' + default: "null" + category: + type: string + description: 'The native integration test category to upload stats for' + default: "null" + secrets: + UPLOAD_COLLECTOR_TOKEN: + description: 'A token used to report build statistics to a collector' + required: false + +jobs: + native-tests-stats-upload: + name: Upload build stats to collector + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + repository: graalvm/mandrel + fetch-depth: 1 + path: workflow-mandrel + - uses: actions/download-artifact@v4 + with: + name: build-stats-${{inputs.category}}-${{ inputs.artifacts-suffix }} + path: . + - name: Extract and import build stats + env: + BUILD_STATS_TAG: ${{ inputs.build-stats-tag }} + UPLOAD_TOKEN: ${{ secrets.UPLOAD_COLLECTOR_TOKEN }} + COLLECTOR_URL: https://collector.foci.life/api/v1/image-stats + shell: bash + run: | + tar -xf build-stats.tgz + echo "Tag for stat upload is going to be: '${BUILD_STATS_TAG}'" + DIR=quarkus/ TAG="${BUILD_STATS_TAG}" TOKEN="${UPLOAD_TOKEN}" URL="${COLLECTOR_URL}" bash workflow-mandrel/.github/import_stats.sh \ No newline at end of file