docs: 更新.gitignore以正确忽略覆盖率相关文件 #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup MoonBit | |
| uses: moonbitlang/setup-moonbit@v1 | |
| with: | |
| version: latest | |
| - name: Build and Test | |
| run: | | |
| moon check | |
| moon test | |
| moon run src/test.mbt | |
| - name: Generate Coverage Report | |
| run: | | |
| # 运行MoonBit测试并生成覆盖率 | |
| moon test --enable-coverage | |
| # 生成Codecov兼容的coverage报告 | |
| moon coverage report -f coveralls -o coverage.json | |
| # 显示生成的文件 | |
| ls -la coverage.* | |
| echo "Generated coverage files:" | |
| if [ -f "coverage.json" ]; then | |
| echo "✅ coverage.json generated successfully" | |
| head -20 coverage.json | |
| else | |
| echo "❌ coverage.json not found" | |
| fi | |
| - name: Upload Coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./coverage.json | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false |