diff --git a/.github/codecov.yaml b/.github/codecov.yaml index cd0b5a5..f20e015 100644 --- a/.github/codecov.yaml +++ b/.github/codecov.yaml @@ -3,6 +3,12 @@ coverage: project: default: informational: true + target: 80% + threshold: 1% patch: default: - target: 0% + target: 80% + threshold: 1% +comment: + layout: " diff, flags, files" + behavior: default diff --git a/.github/workflows/pull_requests.yaml b/.github/workflows/pull_requests.yaml index 31717e1..2e76bbf 100644 --- a/.github/workflows/pull_requests.yaml +++ b/.github/workflows/pull_requests.yaml @@ -61,15 +61,14 @@ jobs: run: | git branch -av git diff origin/${{ github.base_ref }}.. | tee git.diff - - run: cargo mutants --test-tool=nextest -vV --in-place --in-diff git.dff + - run: cargo mutants --test-tool=nextest -vV --in-diff git.diff - uses: actions/upload-artifact@v4 + if: always() # always upload the artifact as this step is highly likely to fail with: - name: mutants-out path: mutants.out + overwrite: true bench: runs-on: ubuntu-latest - permissions: - pull-requests: write steps: - uses: actions/checkout@v4 with: @@ -84,14 +83,43 @@ jobs: uses: actions/upload-artifact@v4 with: path: bench.txt + overwrite: true + update-pr: + if: always() + needs: + - test-incremental-mutants + - bench + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: setup rust + run: | + rustup toolchain install nightly + rustup default nightly + - name: download bench + uses: actions/download-artifact@v4 + with: + path: bench.txt + - name: download mutants + uses: actions/download-artifact@v4 + with: + path: mutants.out - name: prep benchmark comment run: | - echo "## Benchmark Results" > prepped-bench.txt - echo "```sh" >> prepped-bench.txt - cat bench.txt >> prepped-bench.txt - echo "```" >> prepped-bench.txt - - name: add bench to pr + echo "## Benchmark Results" > results.txt + cat "\`\`\`sh" >> results.txt + cat bench.txt >> results.txt + echo "\`\`\`" >> results.txt + echo "## Possible Bugs" >> results.txt + echo "\`\`\`sh" >> results.txt + cat mutants.out/missed.txt >> results.txt + echo "\`\`\`" >> results.txt + - name: update pr comment uses: thollander/actions-comment-pull-request@v2 with: - filePath: prepped-bench.txt + filePath: results.txt comment_tag: execution