Skip to content

Commit

Permalink
refactor: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tung-Huynh-Shopmacher committed Aug 13, 2024
1 parent f557963 commit 0810bd3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Audit

permissions:
actions: read
contents: read

on:
workflow_run:
workflows: ["Build"]
Expand All @@ -26,6 +30,9 @@ jobs:
- name: Run npm audit
run: npm audit

- name: Wait for artifact to become available
run: sleep 30

- name: Download code coverage results
uses: actions/download-artifact@v4
with:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: processor/junit-report.xml
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
11 changes: 11 additions & 0 deletions .github/workflows/testrail.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: TestRail

permissions:
actions: read
contents: read

on:
workflow_run:
workflows: ["Build"]
Expand All @@ -16,9 +20,16 @@ jobs:
with:
python-version: '3.x'

- name: List Available Artifacts
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-s https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts \
| jq '.artifacts[] | .name'
- name: Download code coverage results
uses: actions/download-artifact@v4
with:
name: code-coverage-report
run-id: ${{ github.event.workflow_run.id }}

- name: Upload Test Results to TestRail
Expand Down

0 comments on commit 0810bd3

Please sign in to comment.