Skip to content

Commit

Permalink
Merge pull request #390 from lrozenblyum/387-migrate-from-travis-ci-t…
Browse files Browse the repository at this point in the history
…o-github-actions

Migrate from Travis CI to GitHub actions
  • Loading branch information
lrozenblyum authored Feb 26, 2023
2 parents 2d7993f + b2912aa commit da89f87
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 38 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
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
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,8 @@ The release consists of:
* binaries in *.zip

## Continuous Integration
### Travis CI
Builds: https://travis-ci.com/lrozenblyum/chess/builds

[![Build Status](https://travis-ci.com/lrozenblyum/chess.svg?branch=master)](https://travis-ci.com/lrozenblyum/chess)
### GitHub Actions
[![CI](https://github.com/lrozenblyum/chess/actions/workflows/ci.yml/badge.svg)](https://github.com/lrozenblyum/chess/actions/workflows/ci.yml)

### SonarCloud
Full overview: https://sonarcloud.io/dashboard?id=leokom-chess
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
</execution>
<execution>
<id>report</id>
<!-- By default 'report' is bound to verify phase but we don't call that yet in Travis -->
<!-- By default 'report' is bound to verify phase but we don't call that yet in CI -->
<phase>test</phase>
<goals>
<goal>report</goal>
Expand Down Expand Up @@ -352,4 +352,4 @@
<brandName>LeokomChess</brandName>
<binaryReleaseName>${brandName}-${project.version}</binaryReleaseName>
</properties>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/**
* Author: Leonid
* Trying to avoid Travis limitation on test duration < 10 minutes:
* Historical reasons of the collector usage: trying to avoid Travis limitation on test duration < 10 minutes:
* run every game in a separate test, collect all results and analyze
* Date-time: 24.04.16 22:54
*/
Expand Down

0 comments on commit da89f87

Please sign in to comment.