Skip to content

Commit 9af1d08

Browse files
committed
#109 feat: add codecov and REUSE compliance
- Add codecov.yml with coverage targets (95% project, 90% patch) - Add REUSE compliance structure (.reuse/dep5, LICENSES/) - Add SPDX headers to all Rust files (MIT license) - Switch from dual license to MIT only - Add test analytics via cargo-nextest with JUnit XML output - Add coverage job using cargo-llvm-cov - Add codecov upload for both test results and coverage - Add REUSE lint step to CI workflow
1 parent 0bab8f0 commit 9af1d08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+504
-220
lines changed

.config/nextest.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[profile.ci]
2+
fail-fast = false
3+
retries = 0
4+
5+
[profile.ci.junit]
6+
path = "junit.xml"
7+
store-success-output = true
8+
store-failure-output = true

.github/workflows/reusable-ci.yml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,27 @@ jobs:
7878
cargo +${{ steps.msrv.outputs.msrv }} clippy --workspace --all-targets -- -D warnings
7979
fi
8080
81+
- name: Install cargo-nextest
82+
uses: taiki-e/install-action@v2
83+
with:
84+
tool: cargo-nextest
85+
8186
- name: Tests (MSRV)
8287
shell: bash
8388
run: |
8489
set -euo pipefail
8590
if [ "${{ inputs.all-features }}" = "true" ]; then
86-
cargo +${{ steps.msrv.outputs.msrv }} test --workspace --all-features --no-fail-fast
91+
cargo +${{ steps.msrv.outputs.msrv }} nextest run --workspace --all-features --no-fail-fast --profile ci
8792
else
88-
cargo +${{ steps.msrv.outputs.msrv }} test --workspace --no-fail-fast
93+
cargo +${{ steps.msrv.outputs.msrv }} nextest run --workspace --no-fail-fast --profile ci
8994
fi
9095
96+
- name: Upload test results to Codecov
97+
if: always()
98+
uses: codecov/test-results-action@v1
99+
with:
100+
token: ${{ secrets.CODECOV_TOKEN }}
101+
91102

92103
- name: Auto-commit changes (any branch)
93104
if: always()
@@ -111,3 +122,38 @@ jobs:
111122
112123
- name: Package (dry-run)
113124
run: cargo +${{ steps.msrv.outputs.msrv }} package --locked
125+
126+
- name: REUSE Compliance
127+
uses: fsfe/reuse-action@v5
128+
129+
coverage:
130+
runs-on: ubuntu-latest
131+
steps:
132+
- uses: actions/checkout@v5
133+
134+
- name: Install Rust stable
135+
uses: dtolnay/rust-toolchain@v1
136+
with:
137+
toolchain: stable
138+
139+
- name: Cache cargo
140+
uses: Swatinem/rust-cache@v2
141+
142+
- name: Install cargo-llvm-cov
143+
uses: taiki-e/install-action@v2
144+
with:
145+
tool: cargo-llvm-cov
146+
147+
- name: Generate coverage
148+
shell: bash
149+
run: |
150+
set -euo pipefail
151+
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
152+
153+
- name: Upload coverage to Codecov
154+
uses: codecov/codecov-action@v5
155+
with:
156+
token: ${{ secrets.CODECOV_TOKEN }}
157+
files: lcov.info
158+
fail_ci_if_error: true
159+
verbose: true

.reuse/dep5

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: telegram-webapp-sdk
3+
Upstream-Contact: RAprogramm <[email protected]>
4+
Source: https://github.com/RAprogramm/telegram-webapp-sdk
5+
6+
Files: Cargo.lock
7+
Copyright: 2025 RAprogramm <[email protected]>
8+
License: CC0-1.0
9+
10+
Files: *.md README.md CHANGELOG.md
11+
Copyright: 2025 RAprogramm <[email protected]>
12+
License: CC0-1.0
13+
14+
Files: .gitignore .github/* codecov.yml
15+
Copyright: 2025 RAprogramm <[email protected]>
16+
License: CC0-1.0
17+
18+
Files: *.toml rustfmt.toml .config/nextest.toml
19+
Copyright: 2025 RAprogramm <[email protected]>
20+
License: CC0-1.0
21+
22+
Files: *.json *.yml *.yaml
23+
Copyright: 2025 RAprogramm <[email protected]>
24+
License: CC0-1.0
25+
26+
Files: *.png *.jpg *.svg *.ico
27+
Copyright: 2025 RAprogramm <[email protected]>
28+
License: CC0-1.0
29+
30+
Files: demo/**/*
31+
Copyright: 2025 RAprogramm <[email protected]>
32+
License: CC0-1.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.2.15"
44
rust-version = "1.90"
55
edition = "2024"
66
description = "Telegram WebApp SDK for Rust"
7-
license = "MIT OR Apache-2.0"
7+
license = "MIT"
88
repository = "https://github.com/RAprogramm/telegram-webapp-sdk"
99
readme = "README.md"
1010
documentation = "https://docs.rs/telegram-webapp-sdk"

LICENSE-APACHE

Lines changed: 0 additions & 202 deletions
This file was deleted.

0 commit comments

Comments
 (0)