feat(docs): add individual example tests with line number mapping #4
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, develop] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Ruby 컴파일러 테스트 | |
| test: | |
| name: Ruby ${{ matrix.ruby }} Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby: ['3.0', '3.1', '3.2', '3.3'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Ruby ${{ matrix.ruby }} | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Run tests | |
| run: bundle exec rspec --format progress --format RspecJunitFormatter --out tmp/rspec_results.xml | |
| continue-on-error: false | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-ruby-${{ matrix.ruby }} | |
| path: tmp/rspec_results.xml | |
| # RuboCop 린트 검사 | |
| lint: | |
| name: RuboCop Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - name: Run RuboCop | |
| run: bundle exec rubocop --format github | |
| # 테스트 커버리지 | |
| coverage: | |
| name: Test Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - name: Run tests with coverage | |
| run: | | |
| COVERAGE=true bundle exec rspec | |
| env: | |
| COVERAGE: true | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| # VSCode 플러그인 빌드 | |
| vscode: | |
| name: VSCode Plugin | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: editors/vscode | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: editors/vscode/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Compile | |
| run: npm run compile | |
| # JetBrains 플러그인 빌드 | |
| jetbrains: | |
| name: JetBrains Plugin | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: editors/jetbrains | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Build plugin | |
| run: ./gradlew buildPlugin | |
| - name: Verify plugin | |
| run: ./gradlew verifyPlugin | |
| - name: Upload plugin artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jetbrains-plugin | |
| path: editors/jetbrains/build/distributions/*.zip | |
| # 문서 예제 검증 | |
| docs-verify: | |
| name: Docs Verification | |
| runs-on: ubuntu-latest | |
| continue-on-error: true # Don't fail CI if docs have issues | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - name: Verify documentation examples | |
| run: bundle exec rake docs:verify | |
| # 전체 상태 체크 | |
| ci-status: | |
| name: CI Status | |
| runs-on: ubuntu-latest | |
| needs: [test, lint, coverage, vscode, jetbrains] | |
| if: always() | |
| steps: | |
| - name: Check CI status | |
| run: | | |
| if [[ "${{ needs.test.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.lint.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.coverage.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.vscode.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.jetbrains.result }}" == "failure" ]]; then | |
| echo "CI failed" | |
| exit 1 | |
| fi | |
| echo "CI passed" |