Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
fix: code coverage flags && add cargo deny (#144)
Browse files Browse the repository at this point in the history
* fix: coverage

Signed-off-by: Yuhang Shi <[email protected]>

* fix(rust): fix rust csharp binding targetFramework missing

* feat: remove nightly

Signed-off-by: Yuhang Shi <[email protected]>

* fix: coverage build

Signed-off-by: Yuhang Shi <[email protected]>

* fix: clippy

Signed-off-by: Yuhang Shi <[email protected]>

---------

Signed-off-by: Yuhang Shi <[email protected]>
Co-authored-by: moyil <[email protected]>
  • Loading branch information
Yuhang Shi and moyilong authored Nov 14, 2023
1 parent 0fb77bc commit 737abac
Show file tree
Hide file tree
Showing 13 changed files with 374 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rustflags = ["-C", "target-cpu=sandybridge"]
rustflags = ["-C", "target-cpu=sandybridge"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "target-cpu=apple-m1", "-C", "link-arg=-undefined",
rustflags = ["-C", "target-cpu=apple-m1", "-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup"]

[target.x86_64-apple-darwin]
Expand Down
38 changes: 32 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
paths:
- 'codecov.yml'
- '.github/workflows/coverage.yml'
- 'packages/rust-core/**'
- 'packages/nodejs/**'
- 'packages/kotlin/**'
- 'packages/csharp/**'
Expand All @@ -18,11 +19,37 @@ on:
paths:
- 'codecov.yml'
- '.github/workflows/coverage.yml'
- 'packages/rust-core/**'
- 'packages/nodejs/**'
- 'packages/kotlin/**'
- 'packages/csharp/**'

jobs:
rust:
name: rust-coverage
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly

- run: cargo install cargo-tarpaulin

- name: Generate code coverage
working-directory: packages/rust-core
run: |
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 300 --run-types doctests --run-types lib --run-types tests --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
working-directory: packages/rust-core
token: ${{ secrets.CODECOV_TOKEN }}
flags: rust
name: rust-upload
fail_ci_if_error: true
verbose: true

nodejs:
name: nodejs-coverage
runs-on: ubuntu-latest
Expand All @@ -46,8 +73,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
working-directory: packages/nodejs
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
flags: nodejs
name: nodejs-upload
fail_ci_if_error: true
Expand Down Expand Up @@ -77,8 +103,9 @@ jobs:

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
working-directory: packages/kotlin
token: ${{ secrets.CODECOV_TOKEN }}
flags: kotlin
name: kotlin-upload
fail_ci_if_error: true
Expand Down Expand Up @@ -123,8 +150,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
working-directory: packages/csharp
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
flags: csharp
name: csharp-upload
fail_ci_if_error: true
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ jobs:
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

deny:
name: rust-ci-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- run: cargo install cargo-deny
- run: cargo deny check

windows-test:
name: rust-ci-test-windows
runs-on: windows-latest
Expand Down
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ coverage:
flags:
- csharp
flags:
rust:
paths:
- packages/rust-core/
nodejs:
paths:
- packages/nodejs/
Expand Down
2 changes: 2 additions & 0 deletions packages/rust-core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cobertura.xml
*.profraw
32 changes: 16 additions & 16 deletions packages/rust-core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/rust-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ resolver = "2"
[workspace.package]
license = "Apache-2.0"
repository = "https://github.com/pleisto/flappy"
homepage = "https://flappy.pleisto.com"
edition = "2021"
keywords = []
categories = []

[workspace.dependencies]
mimalloc = { version = "0.1.39", default-features = false }
Expand Down
4 changes: 4 additions & 0 deletions packages/rust-core/csharp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true

publish = false


Expand Down
1 change: 1 addition & 0 deletions packages/rust-core/csharp/Pleisto.Flappy.Native.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageTags>native</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<TargetFrameworks>net7.0;net6.0;netcoreapp3.1;netstandard2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 737abac

Please sign in to comment.