Skip to content
Merged
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
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Cargo Test
run: cargo test --all-features --workspace
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Generate coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
path-to-lcov: lcov.info
draft_release:
needs:
- build
Expand Down
13 changes: 11 additions & 2 deletions crates/forge_ci/src/workflows/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::jobs::{self, ReleaseBuilderJob};

/// Generate the main CI workflow
pub fn generate_ci_workflow() {
// Create a basic build job for CI
// Create a basic build job for CI with coverage
let build_job = Job::new("Build and Test")
.permissions(Permissions::default().contents(Level::Read))
.add_step(Step::checkout())
Expand All @@ -15,7 +15,16 @@ pub fn generate_ci_workflow() {
.with(("repo-token", "${{ secrets.GITHUB_TOKEN }}")),
)
.add_step(Step::toolchain().add_stable())
.add_step(Step::new("Cargo Test").run("cargo test --all-features --workspace"));
.add_step(Step::new("Install cargo-llvm-cov").run("cargo install cargo-llvm-cov"))
.add_step(
Step::new("Generate coverage")
.run("cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info"),
)
.add_step(
Step::new("Upload coverage to Coveralls")
.uses("coverallsapp", "github-action", "v2")
.with(("path-to-lcov", "lcov.info")),
);

let draft_release_job = jobs::create_draft_release_job("build");
let draft_release_pr_job = jobs::create_draft_release_pr_job();
Expand Down
Loading