Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate code coverage and add icon to README.md Issue #3

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ sdl2 = "0.34.0"
rand = "=0.7.3"

[[example]]
name = "snake"
name = "snake"
cargo_metadata = "=0.18.1"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ A (soon to be) fully-featured NES emulator written in Rust.
- [ ] PPU
- [ ] APU

![Coverage Status](https://coveralls.io/repos/github/username/repo/badge.svg?branch=main)

# Resources
- https://github.com/bugzmanov/nes_ebook, where it all started for me
Expand Down
35 changes: 35 additions & 0 deletions test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: rust_ci

on: [push, pull_request]

jobs:
run_tests:
runs-on: ubuntu-latest

steps:
- name: checkout_code
uses: actions/checkout@v2

- name: install_rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: install_cargo_tarpaulin
run: cargo install cargo-tarpaulin

- name: run_tests_with_coverage
run: cargo tarpaulin --out Xml

- name: upload_coverage_data
uses: actions/upload-artifact@v2
with:
name: coverage_report
path: ./tarpaulin-report.xml

- name: generate_coverage_badge
uses: actions-rs/[email protected]
with:
coverage_file: ./tarpaulin-report.xml
badge_path: ./coverage-badge.svg
Loading