-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #390 from lrozenblyum/387-migrate-from-travis-ci-t…
…o-github-actions Migrate from Travis CI to GitHub actions
- Loading branch information
Showing
5 changed files
with
55 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
master | ||
release/** | ||
pull_request: | ||
|
||
jobs: | ||
CI_Sonar: | ||
# carries Sonar secret | ||
environment: CI | ||
env: | ||
# The SonarScanner for Maven automatically picks up the value directly from the environment variable. | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
# According to Sonar: Needed to get PR information, if any | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# unlimited fetch depth for Sonar | ||
fetch-depth: 0 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
# some arbitrary distribution selected | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build with Maven | ||
# -B means: batch-mode (no questions, no progress-related log pollution) | ||
# coverage profile is needed for test coverage for sonar | ||
run: mvn test -Pcoverage -B | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
# some arbitrary distribution selected | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Run Sonar analyzing | ||
# specified the project key explicitly because I didn't like the automatically generate Maven-based name (com.leokom:chess) | ||
# thanks to this explicit specification we're free to change Maven coordinates | ||
# the organization key was found here: https://sonarcloud.io/account/organizations | ||
run: mvn sonar:sonar | ||
-Dsonar.projectKey=leokom-chess | ||
-Dsonar.organization=lrozenblyum-github | ||
-Dsonar.host.url=https://sonarcloud.io |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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