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

ci: add codecov #866

Merged
merged 1 commit into from
Dec 20, 2022
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
80 changes: 80 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,83 @@ jobs:

- name: "Test Go SDK"
run: make test-sdk-go

code-coverage:
name: Run code coverage
runs-on: ${{ matrix.config.os }}
needs: build-rust
strategy:
matrix:
config:
- {
os: "ubuntu-latest",
extension: "",
# We have this enabled for releases, so we should test it.
extraArgs: "--features openssl/vendored",
bindleUrl: "https://bindle.blob.core.windows.net/releases/bindle-v0.8.0-linux-amd64.tar.gz",
bindleBinary: "bindle-server",
pathInBindleArchive: "bindle-server",
nomadUrl: "https://releases.hashicorp.com/nomad/1.3.1/nomad_1.3.1_linux_amd64.zip",
nomadBinary: "nomad",
pathInNomadArchive: "nomad",
hippoUrl: "https://github.com/deislabs/hippo/releases/download/v0.19.0/hippo-server-linux-x64.tar.gz",
}
steps:
- uses: actions/checkout@v2

- name: Install latest Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true

- name: "Install Wasm Rust target"
run: rustup target add wasm32-wasi

- name: Install bindle
uses: engineerd/[email protected]
with:
name: ${{ matrix.config.bindleBinary }}
url: ${{ matrix.config.bindleUrl }}
pathInArchive: ${{ matrix.config.pathInBindleArchive }}

- name: Install nomad
uses: engineerd/[email protected]
with:
name: ${{ matrix.config.nomadBinary }}
url: ${{ matrix.config.nomadUrl }}
pathInArchive: ${{ matrix.config.pathInNomadArchive }}

- name: Install hippo
run: |
curl -L ${{ matrix.config.hippoUrl }} -o hippo-server.tar.gz
mkdir hippo-server-output
tar xz -C hippo-server-output -f hippo-server.tar.gz
cp -r hippo-server-output/**/* ~/configurator/bin
chmod +x ~/configurator/bin/Hippo.Web

- name: Install cargo-tarpaulin binary crate
uses: actions-rs/[email protected]
with:
crate: cargo-tarpaulin
version: latest
use-tool-cache: true

- name: Cargo Tarpaulin
run: cargo tarpaulin --follow-exec --skip-clean -t 6000 --out xml --features openssl/vendored,default,e2e-tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @lann or @radu-matei on if this cargo tarpaulin command suits our needs per the original issue #367

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that's what I use.

env:
RUST_LOG: spin=trace

- name: Upload to codecov.io
uses: codecov/codecov-action@v3
if: ${{ github.ref == 'refs/heads/main' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we only interested in codecov results for main at this time? cc @lann @radu-matei

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would imagine we'd like it for PRs too, but its easy enough to change 🤷

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, we can see how it works for us for main and then potentially create a follow-up.

with:
fail_ci_if_error: true
verbose: true

- name: Archive code coverage results
uses: actions/upload-artifact@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
name: code-coverage-report
path: cobertura.xml
2 changes: 2 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1260,12 +1260,14 @@ route = "/..."

/// Build an app whose component `workdir` is a subdirectory.
#[tokio::test]
#[cfg(not(tarpaulin))]
async fn test_build_command_nested_workdir() -> Result<()> {
do_test_build_command("tests/build/nested").await
}

/// Build an app whose component `workdir` is a sibling.
#[tokio::test]
#[cfg(not(tarpaulin))]
async fn test_build_command_sibling_workdir() -> Result<()> {
do_test_build_command("tests/build/sibling").await
}
Expand Down