Skip to content

Commit

Permalink
sync: from hyginia
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospereira committed Feb 27, 2024
1 parent e90679a commit 7ad338c
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 183 deletions.
49 changes: 36 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,44 +129,65 @@ jobs:
- name: Start Gradle Daemon
run: ./gradlew --info
- run: ./gradlew testClasses
- name: Gradle Tasks Summary
run: cat build/reports/build-times.md >> $GITHUB_STEP_SUMMARY

test:
name: Tests / test
sonar:
name: Code Analysis / SonarCloud
runs-on: ubuntu-latest
needs:
- compile
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: corepack enable
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- run: corepack enable
- name: Set up Gradle and Java
uses: ./.github/gradle-action
- name: Run tests
run: ./gradlew check koverXmlReport
- name: Gradle Tasks Summary
run: cat build/reports/build-times.md >> $GITHUB_STEP_SUMMARY
- name: Run SonarCloud Analysis
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar
- uses: testspace-com/setup-testspace@v1

test:
name: Tests / test
runs-on: ubuntu-latest
needs:
- compile
steps:
- uses: actions/checkout@v4
with:
domain: ${{ github.repository_owner }}
- name: Push result to Testspace server
fetch-depth: 0
- run: corepack enable
- name: Set up Gradle and Java
uses: ./.github/gradle-action
- name: Run tests
run: ./gradlew check koverXmlReport
- name: Buildkite Test Analytics
if: ${{ github.ref == 'refs/heads/main' && always() }}
env:
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_ANALYTICS_TOKEN }}
run: |
testspace ./build/test-results/**/*.xml
./gradlew mergeJUnitReports
COMMIT_MESSAGE=$(git log -n 1 --format="%s")
curl -X POST --fail-with-body \
-H "Authorization: Token token=$BUILDKITE_ANALYTICS_TOKEN" \
-F "data=@build/test-results/junit.xml" \
-F "format=junit" \
-F "run_env[CI]=github_actions" \
-F "run_env[key]=$GITHUB_ACTION-$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" \
-F "run_env[number]=$GITHUB_RUN_NUMBER" \
-F "run_env[branch]=$GITHUB_REF" \
-F "run_env[commit_sha]=$GITHUB_SHA" \
-F "run_env[message]=$COMMIT_MESSAGE" \
-F "run_env[url]=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
https://analytics-api.buildkite.com/v1/uploads
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
continue-on-error: true
Expand Down Expand Up @@ -226,6 +247,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
needs:
- test
- sonar
- test-docker-image
steps:
- run: echo "This PR is ready to merge."
Expand All @@ -236,6 +258,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- test
- sonar
- test-docker-image
steps:
- run: echo "This is a push to main branch. Following with release a new version"
Expand Down
Loading

0 comments on commit 7ad338c

Please sign in to comment.