From 31f6e720438e2c7a70bb796de47b0f2653b28437 Mon Sep 17 00:00:00 2001 From: Zitronenjoghurt Date: Mon, 12 Aug 2024 12:39:06 +0200 Subject: [PATCH] adjust rust workflow, show build/test success badge and test coverage --- .github/workflows/rust.yml | 29 +++++++++++++++++++++-------- README.md | 3 +++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f57159d..dcc51a6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,25 +2,38 @@ name: Rust on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] env: CARGO_TERM_COLOR: always jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build - run: | + - uses: actions/checkout@v4 + - name: Build + run: | cd rust/main_logic cargo build --verbose - - name: Run tests - run: | + - name: Run tests + run: | cd rust/main_logic cargo test --verbose + - name: Install tarpaulin + run: cargo install cargo-tarpaulin + - name: Run tarpaulin + run: | + cd rust/main_logic + cargo tarpaulin --out Xml --output-dir ../../ + - name: Upload to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + files: ./cobertura.xml + flags: unittests + verbose: true diff --git a/README.md b/README.md index 4003006..65fa0f6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ +![Rust](https://github.com/Zitronenjoghurt/LastColony/actions/workflows/rust.yml/badge.svg) +[![codecov](https://codecov.io/gh/Zitronenjoghurt/LastColony/branch/main/graph/badge.svg)](https://codecov.io/gh/Zitronenjoghurt/LastColony) + # LastColony Last Colony is my 4th Godot project and was heavily inspired by Final Earth 2. This will be the first time I will use my own pixel art and Threading in Godot.