From 2c3207a66c5a7f9f1c377177f537f0b880cd9b00 Mon Sep 17 00:00:00 2001 From: kyokuping Date: Thu, 19 Feb 2026 20:09:50 +0900 Subject: [PATCH] ci: implement llvm-cov with Codecov integration --- .github/workflows/ci.yaml | 66 +++++++++++++++++++++++++++++++++++++++ TODO.md | 27 ---------------- 2 files changed, 66 insertions(+), 27 deletions(-) delete mode 100644 TODO.md diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8905d68..dab956b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,6 +27,72 @@ jobs: - name: Run Tests run: cargo test --verbose + - name: Install cargo-llvm-cov + if: github.ref == 'refs/heads/main' + uses: taiki-e/install-action@v2 + with: + toolchain: cargo-llvm-cov + + - name: Install cargo-nextest + if: github.ref == 'refs/heads/main' + uses: taiki-e/install-action@v2 + with: + toolchain: cargo-nextest + + - name: Build and test with coverage + if: github.ref == 'refs/heads/main' + shell: bash + run: | + source <(cargo llvm-cov show-env --export-prefix) + + bins_start=$(date +%s) + cargo build --locked + bins_end=$(date +%s) + bins_duration=$((bins_end - bins_start)) + echo "::notice::Binaries and libraries built in ${bins_duration}s ($(date -ud @${bins_duration} +'%M:%S'))" + + compile_start=$(date +%s) + cargo test --locked --no-run + compile_end=$(date +%s) + compile_duration=$((compile_end - compile_start)) + echo "::notice::Tests compiled in ${compile_duration}s ($(date -ud @${compile_duration} +'%M:%S'))" + + test_start=$(date +%s) + if command -v cargo-nextest &> /dev/null; then + cargo nextest run --locked --no-fail-fast + else + cargo test --locked --no-fail-fast + fi + test_end=$(date +%s) + test_duration=$((test_end - test_start)) + echo "::notice::Tests executed in ${test_duration}s ($(date -ud @${test_duration} +'%M:%S'))" + + build_duration=$((bins_duration + compile_duration)) + total_duration=$((build_duration + test_duration)) + echo "" + echo "=========================================" + echo "All targets build: ${bins_duration}s ($(date -ud @${bins_duration} +'%M:%S'))" + echo "Tests compile: ${compile_duration}s ($(date -ud @${compile_duration} +'%M:%S'))" + echo "Tests execute: ${test_duration}s ($(date -ud @${test_duration} +'%M:%S'))" + echo "-----------------------------------------" + echo "Total build: ${build_duration}s ($(date -ud @${build_duration} +'%M:%S'))" + echo "Total time: ${total_duration}s ($(date -ud @${total_duration} +'%M:%S'))" + echo "=========================================" + + cargo llvm-cov report --codecov --output-path codecov.json + echo "Coverage report generated: codecov.json" + ls -la codecov.json + + - name: Upload coverage to Codecov + if: github.ref == 'refs/heads/main' + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: codecov.json + flags: rust + verbose: true + fail_ci_if_error: false + lint_and_shear: name: Lint and Dependency Check runs-on: ubuntu-latest diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 373162a..0000000 --- a/TODO.md +++ /dev/null @@ -1,27 +0,0 @@ -mime type 구현 -```kdl -// 기본 MIME 매핑 오버라이드 -mimetypes { - xyz "chemical/x-xyz" // 아까 그 '이색히' 추가 -} - -// 특정 조건에 따른 헤더 추가 -headers { - match path="/static/*" { - Cache-Control "max-age=86400" - } -} -``` - -개별 라우트: 필요한 곳만 명시적으로 켬 -```kdl -route "/pub/linux" { - root "/mnt/storage/linux" - directory_listing true // 전역 설정을 무시하고 활성화 -} - -route "/private" { - root "/home/user/secret" - // 명시하지 않으면 전역 설정(false)을 따름 -} -```