From 379f02892511a06856d524e9d69428dd7649d07d Mon Sep 17 00:00:00 2001 From: Neha Singh Date: Mon, 18 Sep 2023 13:49:38 -0400 Subject: [PATCH] Improve output message --- .github/workflows/main.yml | 56 ++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fed3549..5a5e382 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,15 +22,15 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - # - name: Test with pytest - # run: | - # coverage run -m pytest tests - # coverage xml -o coverage/python.xml - # - name: Report python coverage - # uses: orgoro/coverage@v3 - # with: - # coverageFile: coverage/python.xml - # token: ${{ secrets.GITHUB_TOKEN }} + - name: Test with pytest + run: | + coverage run -m pytest tests + coverage xml -o coverage/python.xml + - name: Report python coverage + uses: orgoro/coverage@v3 + with: + coverageFile: coverage/python.xml + token: ${{ secrets.GITHUB_TOKEN }} - name: 'Authenticate to Google Cloud' id: 'auth' uses: 'google-github-actions/auth@v1' @@ -56,20 +56,20 @@ jobs: npm run artifactregistry-login npm install npm test -- --coverage --coverageReporters="json-summary" --coverageReporters="text" | tee ./coverage.txt - # - name: Report javascript coverage - # uses: MishaKav/jest-coverage-comment@v1.0.23 - # with: - # title: "JavaScript Coverage" - # summary-title: "Summary" - # coverage-title: "Modified Files" - # github-token: ${{ secrets.GITHUB_TOKEN }} - # report-only-changed-files: true - # coverage-path: ./supply-chain/coverage.txt - # coverage-summary-path: ./supply-chain/coverage/coverage-summary.json - # coverage-path-prefix: supply-chain/src/ - # - name: Run linting - # run: | - # pre-commit run --all-files + - name: Report javascript coverage + uses: MishaKav/jest-coverage-comment@v1.0.23 + with: + title: "JavaScript Coverage" + summary-title: "Summary" + coverage-title: "Modified Files" + github-token: ${{ secrets.GITHUB_TOKEN }} + report-only-changed-files: true + coverage-path: ./supply-chain/coverage.txt + coverage-summary-path: ./supply-chain/coverage/coverage-summary.json + coverage-path-prefix: supply-chain/src/ + - name: Run linting + run: | + pre-commit run --all-files - name: Build output files run: | cd supply-chain @@ -80,13 +80,15 @@ jobs: cd supply-chain find public -name "*.js" -exec grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:()-]+" {} \; | sort -u > linklist.txt printf '%s\n%s\n' "# LinkChecker URL list\n# " "$(cat linklist.txt)" > linklist.txt - linkchecker linklist.txt --check-extern --ignore-url="https://.*\.fastly\.net/.*" --ignore-url="https://.*\.mapbox\..*" -o failures > output.txt || true + linkchecker linklist.txt --check-extern --ignore-url="https://.*\.fastly\.net/.*" -o failures > output.txt || true cat output.txt - echo "link_check=$(wc -l < output.txt | sed 's/^ *//g')" >> $GITHUB_OUTPUT + echo "num_links=$(wc -l < output.txt | sed 's/^ *//g')" >> $GITHUB_OUTPUT + echo "links=$(cat output.txt)" >> $GITHUB_OUTPUT - name: Edit PR comment about link checking - if: steps.link_check.outputs.link_check > 0 + if: steps.link_check.outputs.num_links > 0 uses: thollander/actions-comment-pull-request@v2 with: message: | - There are ${{ steps.link_check.outputs.link_check }} broken links. Check the output of the link check build step for details. + There are ${{ steps.link_check.outputs.num_links }} broken links. Check the code for these links: + ${{ steps.link_check.outputs.links }} comment_tag: link_check_msg