From 331ccde8e8b82ea5675e64e58fd5ffeb01d31fa8 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Mon, 12 Aug 2024 10:33:40 +0200 Subject: [PATCH] Set PR number and SHA hash in Codecov upload --- .github/workflows/build-wheels.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 806dc2f0..5072e5f6 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -24,8 +24,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, windows-latest, macos-12 ] +# os: [ ubuntu-latest, windows-latest, macos-12 ] + os: [ ubuntu-latest ] env: + CIBW_BUILD: "cp312*" CIBW_SKIP: "*-musllinux*" CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_ARCHS_LINUX: "x86_64" @@ -242,11 +244,18 @@ jobs: TOKENLESS: ${{ github.event.pull_request.head.label }} run: | set -e + + PR="" + if [ -n '${{ github.event.pull_request.head.sha }}' ]; then + PR="--pr ${{ github.event.number }}" + fi + python${PYTHON_VERSION} -m codecov_cli.main do-upload \ --file report.junit.xml \ --report-type test_results \ - --sha ${{ github.sha }} \ + --sha ${{ github.event.pull_request.head.sha || github.sha }} \ --branch ${{ github.event.pull_request.head.label || github.ref_name }} \ + $PR \ --slug ${{ github.repository }} \ --git-service github \ --fail-on-error @@ -254,8 +263,9 @@ jobs: python${PYTHON_VERSION} -m codecov_cli.main upload-process \ --file coverage.xml \ --report-type coverage \ - --sha ${{ github.sha }} \ + --sha ${{ github.event.pull_request.head.sha || github.sha }} \ --branch ${{ github.event.pull_request.head.label || github.ref_name }} \ + $PR \ --slug ${{ github.repository }} \ --git-service github \ --fail-on-error