mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-13 12:12:25 -06:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
897b9b8621 | ||
|
|
ee2569b70c | ||
|
|
84caa6c25f |
40
.github/workflows/coverage.yaml
vendored
40
.github/workflows/coverage.yaml
vendored
@@ -9,8 +9,6 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
coverage:
|
coverage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -48,35 +46,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate coverage report
|
- name: Generate coverage report
|
||||||
run: |
|
run: |
|
||||||
just coverage
|
just coverage-codecov
|
||||||
|
|
||||||
- name: Download Coveralls CLI
|
- name: Upload coverage reports to Codecov
|
||||||
if: ${{ env.COVERALLS_REPO_TOKEN != '' }}
|
uses: codecov/codecov-action@v5
|
||||||
run: |
|
with:
|
||||||
# use GitHub Releases URL instead of coveralls.io because they can't maintain their own files; it 404s
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
curl -L https://github.com/coverallsapp/coverage-reporter/releases/download/v0.6.15/coveralls-linux-x86_64.tar.gz | tar -xz -C /usr/local/bin
|
files: ./codecov.json
|
||||||
|
disable_search: true
|
||||||
- name: Upload coverage to Coveralls
|
|
||||||
if: ${{ env.COVERALLS_REPO_TOKEN != '' }}
|
|
||||||
run: |
|
|
||||||
if [ ! -f "lcov.info" ]; then
|
|
||||||
echo "Error: lcov.info file not found. Coverage generation may have failed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in {1..10}; do
|
|
||||||
echo "Attempt $i: Uploading coverage to Coveralls..."
|
|
||||||
if coveralls -n report lcov.info; then
|
|
||||||
echo "Successfully uploaded coverage report."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $i -lt 10 ]; then
|
|
||||||
delay=$((2**i))
|
|
||||||
echo "Attempt $i failed. Retrying in $delay seconds..."
|
|
||||||
sleep $delay
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Failed to upload coverage report after 10 attempts."
|
|
||||||
exit 1
|
|
||||||
|
|||||||
18
Justfile
18
Justfile
@@ -11,7 +11,7 @@ binary_extension := if os() == "windows" { ".exe" } else { "" }
|
|||||||
# !!! --remap-path-prefix prevents the absolute path from being used in the generated report
|
# !!! --remap-path-prefix prevents the absolute path from being used in the generated report
|
||||||
|
|
||||||
# Generate HTML report (for humans, source line inspection)
|
# Generate HTML report (for humans, source line inspection)
|
||||||
html: coverage
|
html: coverage-lcov
|
||||||
cargo llvm-cov report \
|
cargo llvm-cov report \
|
||||||
--remap-path-prefix \
|
--remap-path-prefix \
|
||||||
--ignore-filename-regex "{{ coverage_exclude_pattern }}" \
|
--ignore-filename-regex "{{ coverage_exclude_pattern }}" \
|
||||||
@@ -19,13 +19,13 @@ html: coverage
|
|||||||
--open
|
--open
|
||||||
|
|
||||||
# Display report (for humans)
|
# Display report (for humans)
|
||||||
report-coverage: coverage
|
report-coverage: coverage-lcov
|
||||||
cargo llvm-cov report \
|
cargo llvm-cov report \
|
||||||
--remap-path-prefix \
|
--remap-path-prefix \
|
||||||
--ignore-filename-regex "{{ coverage_exclude_pattern }}"
|
--ignore-filename-regex "{{ coverage_exclude_pattern }}"
|
||||||
|
|
||||||
# Run & generate report (for CI)
|
# Run & generate LCOV report (as base report)
|
||||||
coverage:
|
coverage-lcov:
|
||||||
cargo llvm-cov \
|
cargo llvm-cov \
|
||||||
--lcov \
|
--lcov \
|
||||||
--remap-path-prefix \
|
--remap-path-prefix \
|
||||||
@@ -34,6 +34,16 @@ coverage:
|
|||||||
--profile coverage \
|
--profile coverage \
|
||||||
--no-fail-fast nextest
|
--no-fail-fast nextest
|
||||||
|
|
||||||
|
# Run & generate Codecov report (for CI)
|
||||||
|
coverage-codecov:
|
||||||
|
cargo llvm-cov \
|
||||||
|
--codecov \
|
||||||
|
--remap-path-prefix \
|
||||||
|
--ignore-filename-regex "{{ coverage_exclude_pattern }}" \
|
||||||
|
--output-path codecov.json \
|
||||||
|
--profile coverage \
|
||||||
|
--no-fail-fast nextest
|
||||||
|
|
||||||
# Profile the project using 'samply'
|
# Profile the project using 'samply'
|
||||||
samply:
|
samply:
|
||||||
cargo build --profile profile
|
cargo build --profile profile
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# Pac-Man
|
# Pac-Man
|
||||||
|
|
||||||
[![Tests Status][badge-test]][test] [![Build Status][badge-build]][build] [![If you're seeing this, Coveralls.io is broken again and it's not my fault.][badge-coverage]][coverage] [![Online Demo][badge-online-demo]][demo] [![Last Commit][badge-last-commit]][commits]
|
[![Tests Status][badge-test]][test] [![Build Status][badge-build]][build] [![Code Coverage][badge-coverage]][coverage] [![Online Demo][badge-online-demo]][demo] [![Last Commit][badge-last-commit]][commits]
|
||||||
|
|
||||||
[badge-test]: https://github.com/Xevion/Pac-Man/actions/workflows/tests.yaml/badge.svg
|
[badge-test]: https://github.com/Xevion/Pac-Man/actions/workflows/tests.yaml/badge.svg
|
||||||
[badge-build]: https://github.com/Xevion/Pac-Man/actions/workflows/build.yaml/badge.svg
|
[badge-build]: https://github.com/Xevion/Pac-Man/actions/workflows/build.yaml/badge.svg
|
||||||
[badge-coverage]: https://coveralls.io/repos/github/Xevion/Pac-Man/badge.svg?branch=master
|
[badge-coverage]: https://codecov.io/github/Xevion/Pac-Man/branch/master/graph/badge.svg?token=R2RBYUQK3I
|
||||||
[badge-demo]: https://img.shields.io/github/deployments/Xevion/Pac-Man/github-pages?label=GitHub%20Pages
|
[badge-demo]: https://img.shields.io/github/deployments/Xevion/Pac-Man/github-pages?label=GitHub%20Pages
|
||||||
[badge-online-demo]: https://img.shields.io/badge/GitHub%20Pages-Demo-brightgreen
|
[badge-online-demo]: https://img.shields.io/badge/GitHub%20Pages-Demo-brightgreen
|
||||||
[badge-last-commit]: https://img.shields.io/github/last-commit/Xevion/Pac-Man
|
[badge-last-commit]: https://img.shields.io/github/last-commit/Xevion/Pac-Man
|
||||||
[build]: https://github.com/Xevion/Pac-Man/actions/workflows/build.yaml
|
[build]: https://github.com/Xevion/Pac-Man/actions/workflows/build.yaml
|
||||||
[test]: https://github.com/Xevion/Pac-Man/actions/workflows/tests.yaml
|
[test]: https://github.com/Xevion/Pac-Man/actions/workflows/tests.yaml
|
||||||
[coverage]: https://coveralls.io/github/Xevion/Pac-Man?branch=master
|
[coverage]: https://codecov.io/github/Xevion/Pac-Man
|
||||||
[demo]: https://xevion.github.io/Pac-Man/
|
[demo]: https://xevion.github.io/Pac-Man/
|
||||||
[commits]: https://github.com/Xevion/Pac-Man/commits/master
|
[commits]: https://github.com/Xevion/Pac-Man/commits/master
|
||||||
|
|
||||||
|
|||||||
17
codecov.yml
Normal file
17
codecov.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
coverage:
|
||||||
|
status:
|
||||||
|
project:
|
||||||
|
default:
|
||||||
|
target: 70%
|
||||||
|
patch:
|
||||||
|
default:
|
||||||
|
informational: true
|
||||||
|
|
||||||
|
ignore:
|
||||||
|
- "src/(?:bin|platform))/.+\\.rs"
|
||||||
|
- "src/(?:app|events|formatter)\\.rs"
|
||||||
|
|
||||||
|
comment:
|
||||||
|
layout: "reach,diff,flags,files,footer"
|
||||||
|
behavior: default
|
||||||
|
require_changes: false
|
||||||
Reference in New Issue
Block a user