diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 625553fa..5fb68ec2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -106,6 +106,16 @@ jobs: run: just test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get code coverage + run: just test-coverage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage data to codecov + uses: codecov/codecov-action@v4 + with: + files: lcov.info + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} - run: git add . && git diff - run: git diff --cached - name: Ensure no files have changed diff --git a/justfile b/justfile index 34603430..3bf850eb 100644 --- a/justfile +++ b/justfile @@ -28,6 +28,7 @@ package-language-plugin VERSION: install-requirements: rustup component add rustfmt + rustup component add llvm-tools-preview cargo binstall --no-confirm cargo-nextest@{{NEXTEST_VERSION}} cargo binstall --no-confirm cargo-component@{{CARGO_COMPONENT_VERSION}} cargo binstall --no-confirm sd@{{SD_VERSION}} @@ -120,6 +121,10 @@ publish-providers: test: cargo nextest run --workspace --timings +test-coverage: + cargo llvm-cov --no-report -p pulumi_wasm_core + cargo llvm-cov report --lcov --output-path lcov.info + docs: docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material