From 381700661ab48bfa6d6063d3b7bba843d1a9c4c1 Mon Sep 17 00:00:00 2001 From: Vladimir Milosevic Date: Thu, 30 Jan 2025 13:44:44 +0000 Subject: [PATCH 1/2] Update how github job id is fetched --- .github/workflows/build-and-test.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4a259d892..33d2fb03b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -85,27 +85,23 @@ jobs: - /mnt/dockercache:/mnt/dockercache steps: + - name: Fetch job id + id: fetch-job-id + uses: tenstorrent/tt-github-actions/.github/actions/job_id + with: + job_name: "${{ github.job }} (${{ matrix.build.runs-on }}, ${{ matrix.test_group_id }})" + - name: Set reusable strings id: strings shell: bash env: - job-name: "${{ github.job }} (${{ matrix.build.runs-on }}, ${{ matrix.test_group_id }})" + JOB_ID: ${{ steps.fetch-job-id.outputs.job_id }} run: | echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT" echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT" - - # Github job context unfortunately doesn't contain job_id, this is the workaround how to fetch it using GH API - echo "Expected job name: ${{ env.job-name }}" - JOB_ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}/jobs" | \ - jq -r '.jobs[] | select(.name | contains("${{ env.job-name }}")) | .id ') - echo "Current job id: $JOB_ID" - - echo "job-id=$JOB_ID" >> "$GITHUB_OUTPUT" echo "test_report_path=reports/report_$JOB_ID.xml" >> "$GITHUB_OUTPUT" echo "perf_report_path=reports/forge-benchmark-e2e-mnist_$JOB_ID.json" >> "$GITHUB_OUTPUT" - - name: Git safe dir run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }} From 105f7aabcf2d372071195d3b46a8044b9184cc13 Mon Sep 17 00:00:00 2001 From: Vladimir Milosevic Date: Thu, 30 Jan 2025 14:11:34 +0000 Subject: [PATCH 2/2] uses @main --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 33d2fb03b..defefbbe8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -87,7 +87,7 @@ jobs: - name: Fetch job id id: fetch-job-id - uses: tenstorrent/tt-github-actions/.github/actions/job_id + uses: tenstorrent/tt-github-actions/.github/actions/job_id@main with: job_name: "${{ github.job }} (${{ matrix.build.runs-on }}, ${{ matrix.test_group_id }})"