{"id":19293496,"url":"https://github.com/reloaded-project/devops-rust-test-and-coverage","last_synced_at":"2026-03-19T09:07:51.626Z","repository":{"id":245480682,"uuid":"818062875","full_name":"Reloaded-Project/devops-rust-test-and-coverage","owner":"Reloaded-Project","description":"A GitHub Action for Testing Rust Projects with Coverage. Supports Cross Compilation.","archived":false,"fork":false,"pushed_at":"2026-02-14T14:13:34.000Z","size":223,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"v1-master","last_synced_at":"2026-02-14T22:14:59.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Reloaded-Project.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-21T02:54:55.000Z","updated_at":"2026-02-14T14:13:16.000Z","dependencies_parsed_at":"2025-02-24T00:24:41.320Z","dependency_job_id":"3d8541c0-64d4-438c-8e25-11b6f13ecc6e","html_url":"https://github.com/Reloaded-Project/devops-rust-test-and-coverage","commit_stats":null,"previous_names":["reloaded-project/devops-rust-test-and-coverage"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Reloaded-Project/devops-rust-test-and-coverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2Fdevops-rust-test-and-coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2Fdevops-rust-test-and-coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2Fdevops-rust-test-and-coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2Fdevops-rust-test-and-coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Reloaded-Project","download_url":"https://codeload.github.com/Reloaded-Project/devops-rust-test-and-coverage/tar.gz/refs/heads/v1-master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2Fdevops-rust-test-and-coverage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29868696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T18:42:30.764Z","status":"ssl_error","status_checked_at":"2026-02-26T18:41:47.936Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T22:35:13.894Z","updated_at":"2026-02-26T19:36:35.911Z","avatar_url":"https://github.com/Reloaded-Project.png","language":null,"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Reloaded-Project/devops-rust-test-and-coverage\" target=\"_blank\"\u003e\n    \u003cimg src=\"assets/reloaded-logo.png\" alt=\"Logo\" width=\"100\" height=\"100\"\u003e\n  \u003c/a\u003e\n\n  \u003ch1 align=\"center\"\u003eReloaded Rust Test and Coverage GitHub Action\u003c/h1\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Reloaded-Project/devops-rust-test-and-coverage/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nThis GitHub Action allows you to easily run tests for your Rust library and upload the coverage results to Codecov. It supports various configurations, including specifying the Rust toolchain, target platform, features, and more.\n\n## Features\n\n- 🦀 Test your Rust library using `cargo` or `cross`\n- 📊 Optional coverage reports using Tarpaulin (only when using `cargo`)\n- ⚡ Fast Tarpaulin installation via `cargo binstall`\n- 📤 Upload coverage results to Codecov (only when using `cargo` and Tarpaulin)\n- 🛠️ Customize Rust toolchain and target platform\n- 📦 Enable or disable default features\n- 🔧 Specify additional features to test with\n- 💾 Optional Rust toolchain caching for faster builds\n- 🎛️ Pass additional arguments to the `cargo test` command\n- 🚀 Run custom commands before test execution\n\n## Usage\n\nTo use this action in your GitHub workflow, add the following step:\n\n```yaml\n- name: Run Tests and Upload Coverage\n  uses: Reloaded-Project/devops-rust-test-and-coverage@v1\n  with:\n    rust-project-path: '.'\n    rust-toolchain: 'stable'\n    target: 'x86_64-unknown-linux-gnu'\n    install-rust-toolchain: true\n    setup-rust-cache: true\n    use-tarpaulin: true\n    use-binstall: true\n    install-binstall: true\n    upload-coverage: true\n    codecov-token: ${{ secrets.CODECOV_TOKEN }}\n    codecov-flags: 'unittests'\n    codecov-name: 'codecov-umbrella'\n    features: 'feature1 feature2'\n    packages: |\n      package-a\n      package-b\n    no-default-features: false\n    use-cross: false\n    additional-test-args: '--ignored --test-threads=1'\n    additional-tarpaulin-args: '--exclude-files \"*/tests/*\"'\n    pre-test-command: 'echo \"Running pre-test setup\"'\n```\n\n## Inputs\n\n| Input                       | Description                                                                                        | Required | Default              |\n| --------------------------- | -------------------------------------------------------------------------------------------------- | -------- | -------------------- |\n| `rust-project-path`         | Path to the Rust project                                                                           | No       | `'.'`                |\n| `rust-toolchain`            | Rust toolchain to use for building and testing (e.g., stable, nightly, 1.75.0, nightly-2024-02-08) | No       | `'stable'`           |\n| `target`                    | The target platform for the Rust compiler                                                          | No       | `''`                 |\n| `install-rust-toolchain`    | Whether to install the specified Rust toolchain                                                    | No       | `true`               |\n| `setup-rust-cache`          | Whether to set up Rust caching                                                                     | No       | `true`               |\n| `use-tarpaulin`             | Whether to use Tarpaulin for code coverage. If false, only runs tests.                             | No       | `true`               |\n| `use-binstall`              | Use `cargo-binstall` for installing tarpaulin. Else uses cargo install.                            | No       | `true`               |\n| `install-binstall`          | Installs `cargo-binstall`. If false, assumes it is already available.                              | No       | `true`               |\n| `upload-coverage`           | Whether to upload coverage to Codecov (only when using `cargo` and Tarpaulin)                      | No       | `true`               |\n| `codecov-token`             | Codecov token for uploading coverage                                                               | No       | N/A                  |\n| `codecov-flags`             | Flags to pass to Codecov                                                                           | No       | `'unittests'`        |\n| `codecov-name`              | Custom defined name for the upload                                                                 | No       | `'codecov-umbrella'` |\n| `features`                  | Space-separated list of features to enable during testing                                          | No       | `''`                 |\n| `packages`                  | Multi-line list of package names to test (one per line). If empty, tests all packages in workspace | No       | `''`                 |\n| `no-default-features`       | Disable default features during testing                                                            | No       | `false`              |\n| `use-cross`                 | Use cross-rs for testing. If false, use cargo.                                                     | No       | `false`              |\n| `additional-test-args`      | Additional arguments to pass to the cargo test command                                             | No       | `''`                 |\n| `additional-tarpaulin-args` | Additional arguments to pass to the cargo tarpaulin command                                        | No       | `''`                 |\n| `pre-test-command`          | Bash command to run before executing tests                                                         | No       | `''`                 |\n\n## Example Workflow\n\nHere's an example workflow that uses this action with a matrix of configurations:\n\n```yaml\nname: Test and Coverage\n\non: [push]\n\njobs:\n  test_and_coverage:\n    strategy:\n      matrix:\n        include:\n          - os: ubuntu-latest\n            target: x86_64-unknown-linux-gnu\n            use-cross: false\n          - os: ubuntu-latest \n            target: i686-unknown-linux-gnu\n            use-cross: false\n          - os: ubuntu-latest\n            target: aarch64-unknown-linux-gnu\n            use-cross: true\n          - os: ubuntu-latest\n            target: armv7-unknown-linux-gnueabihf\n            use-cross: true\n    runs-on: ${{ matrix.os }}\n    steps:\n      - uses: actions/checkout@v2\n      - name: Run Tests and Upload Coverage\n        uses: Reloaded-Project/devops-rust-test-and-coverage@v1\n        with:\n          codecov-token: ${{ secrets.CODECOV_TOKEN }}\n          features: 'feature1 feature2'\n          no-default-features: true\n          use-cross: ${{ matrix.use-cross }}\n          use-tarpaulin: ${{ matrix.use-tarpaulin }}\n          target: ${{ matrix.target }}\n```\n\nThis workflow runs on every push and performs the following steps:\n1. Checks out the repository\n2. Runs the tests using `cargo` or `cross` based on the matrix configuration\n3. Generates a coverage report using Tarpaulin (only when enabled and using `cargo`)\n4. Uploads the coverage report to Codecov (only when Tarpaulin is enabled)\n\n**Notes:** \n- Code coverage is skipped when using `cross`\n- Tarpaulin can be disabled for platforms where it's unsupported\n- When Tarpaulin is disabled, the action will only run tests without generating coverage reports\n\n## Performance Tips\n\n### Multiple Action Calls\n\nIf you're calling this action multiple times within the same job (e.g., testing different feature combinations),\nyou can optimize build times by being selective about certain setup options on subsequent calls:\n\n```yaml\n# First call - full setup\n- name: Run Tests (First Call)\n  uses: Reloaded-Project/devops-rust-test-and-coverage@v1\n  with:\n    setup-rust-cache: true\n    install-rust-toolchain: true\n    install-binstall: true\n    # ... other options\n\n# Subsequent calls - skip redundant setup\n- name: Run Tests with Different Features\n  uses: Reloaded-Project/devops-rust-test-and-coverage@v1\n  with:\n    setup-rust-cache: false      # Cache already set up\n    install-rust-toolchain: false # Toolchain already installed\n    install-binstall: false       # cargo-binstall already available\n    features: 'different-features'\n    # ... other options\n```\n\n**Key optimizations:**\n\n- `setup-rust-cache: false` - Skip cache setup after the first call\n- `install-rust-toolchain: false` - Skip toolchain installation if already installed\n- `install-binstall: false` - Skip cargo-binstall installation if already available\n\nThis can significantly reduce build times when running multiple test configurations in the same job.\n\n### Caching with binstall\n\nThe action automatically configures Rust caching based on your settings:\n\n- When `use-binstall` is enabled (default), binary caching (`cache-bin`) is disabled\n  - To prevent conflicts between `cargo-binstall` and the cache\n  - Because it's assumed you'd use `cargo-binstall` for all CI tooling.\n- When `use-binstall` is disabled, binary caching is enabled for normal `cargo install` operations\n\n### Workflow for Binary Projects\n\nThis action is designed for Rust libraries without binary artifacts.\n\nIf you're working on a project with binary artifacts, consider using [devops-rust-lightweight-binary][rust-lw-binary],\ninstead, which will invoke this action as part of its workflow if tests are enabled.\n\n### Rust Toolchain Examples\n\nYou can specify various Rust toolchain versions:\n\n```yaml\n# Use stable channel\nrust-toolchain: 'stable'\n\n# Use nightly channel\nrust-toolchain: 'nightly'\n\n# Use specific version\nrust-toolchain: '1.75.0'\n\n# Use specific nightly date\nrust-toolchain: 'nightly-2024-02-08'\n\n# Use beta channel\nrust-toolchain: 'beta'\n```\n\n## License\n\nThis GitHub Action is released under the [MIT License](LICENSE).\n\n[rust-lw-binary]: https://github.com/Reloaded-Project/devops-rust-lightweight-binary\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freloaded-project%2Fdevops-rust-test-and-coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freloaded-project%2Fdevops-rust-test-and-coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freloaded-project%2Fdevops-rust-test-and-coverage/lists"}