feat(scheduler): add ShedLock to prevent concurrent job execution #115
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 - Library API | |
| on: | |
| push: | |
| branches: [ "main", "develop" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Necessário para SonarCloud analisar deltas corretamente | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| cache: gradle | |
| - name: Grant execute permission for Gradle | |
| run: chmod +x gradlew | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Build + Test + Coverage | |
| run: ./gradlew clean build --quiet # ← Reduz logs | |
| - name: SonarCloud Scan | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: ./gradlew sonar --info | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 - pinned SHA | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: build/reports/jacoco/test/jacocoTestReport.xml | |
| fail_ci_if_error: true | |
| verbose: false | |