Skip to content

Commit

Permalink
Merge pull request #20 from asimmon/feature/update-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
asimmon authored Feb 22, 2023
2 parents 77d52f1 + c6d9c79 commit 48c3374
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ on:
workflow_dispatch:
push:
branches: [main]
paths-ignore: ["*.md"]
pull_request:
branches: [main]
paths-ignore: ["*.md"]

jobs:
pack:
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EphemeralMongo - temporary and disposable MongoDB for integration tests and local debugging

[![build](https://img.shields.io/github/actions/workflow/status/asimmon/ephemeral-mongo/ci.yml?logo=github)](https://github.com/asimmon/ephemeral-mongo/actions/workflows/ci.yml)
[![build](https://img.shields.io/github/actions/workflow/status/asimmon/ephemeral-mongo/release.yml?logo=github)](https://github.com/asimmon/ephemeral-mongo/actions/workflows/release.yml)

**EphemeralMongo** is a set of three NuGet packages wrapping the binaries of **MongoDB 4**, **5** and **6**.
Each package targets **.NET Standard 2.0**, which means you can use it with **.NET Framework 4.5.2** up to **.NET 6 and later**.
Expand Down Expand Up @@ -77,6 +77,27 @@ using (var runner = MongoRunner.Run(options))
* By default, a unique temporary data directory is used.


## Reducing the download size

EphemeralMongo4, 5 and 6 are NuGet *metapackages* that reference dedicated runtime packages for both Linux, macOS and Windows.
As of now, there isn't a way to optimize NuGet package downloads for a specific operating system (see [#2](https://github.com/asimmon/ephemeral-mongo/issues/2)).
However, one can still avoid referencing the metapackage and directly reference the dependencies instead. Add MSBuild OS platform conditions and you'll get optimized NuGet imports for your OS and less downloads.

Instead of doing this:

```xml
<PackageReference Include="EphemeralMongo6" Version="1.0.0" />
```

Do this:
```xml
<PackageReference Include="EphemeralMongo.Core" Version="1.0.0" />
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.0.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.0.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.0.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
```


## Tips

Avoid calling `MongoRunner.Run` concurrently, as this will create many `mongod` processes and make your operating system slower.
Expand Down

0 comments on commit 48c3374

Please sign in to comment.