From b4a74fed69ccea7baf4b3a42a9f65a1b1900a604 Mon Sep 17 00:00:00 2001 From: Tung Huynh Date: Tue, 13 Aug 2024 09:21:47 +0700 Subject: [PATCH] refactor: github actions --- .github/workflows/audit.yml | 3 +++ .github/workflows/build.yml | 12 +++++++++++- .github/workflows/testrail.yml | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 63caa55..0ccea1e 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -26,6 +26,9 @@ jobs: - name: Run npm audit run: npm audit + - name: Wait for artifact to become available + run: sleep 5 + - name: Download code coverage results uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d2d4fc..532ef0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,4 +45,14 @@ jobs: uses: actions/upload-artifact@v4 with: name: code-coverage-report - path: processor/junit-report.xml \ No newline at end of file + path: processor/junit-report.xml + + - name: Confirm Artifact Upload + run: | + echo "Checking for uploaded artifacts..." + if [ ! "$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s https://api.github.com/repos/${{ github.repository }}/actions/artifacts | jq '.artifacts[] | select(.name=="code-coverage-report") | .name')" ]; then + echo "Artifact 'code-coverage-report' not found!" + exit 1 + else + echo "Artifact 'code-coverage-report' found successfully." + fi \ No newline at end of file diff --git a/.github/workflows/testrail.yml b/.github/workflows/testrail.yml index a0c84ab..328204e 100644 --- a/.github/workflows/testrail.yml +++ b/.github/workflows/testrail.yml @@ -16,6 +16,9 @@ jobs: with: python-version: '3.x' + - name: Wait for artifact to become available + run: sleep 5 + - name: Download code coverage results uses: actions/download-artifact@v4 with: