Skip to content

Commit 8410193

Browse files
committed
Replace Travis CI with GitHub Actions workflows
- Add CI workflow for test + SonarCloud analysis on push/PR to main - Add Release workflow for GPG signing on push to releases branch - Remove .travis.yml and .travis/ directory - Update README badge from Travis to GitHub Actions https://claude.ai/code/session_01KxvyXRVVZaLrgTZshvsZY6
1 parent b5bd483 commit 8410193

5 files changed

Lines changed: 74 additions & 131 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '11'
19+
distribution: 'temurin'
20+
21+
- name: Cache Maven packages
22+
uses: actions/cache@v4
23+
with:
24+
path: ~/.m2/repository
25+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
26+
restore-keys: |
27+
${{ runner.os }}-maven-
28+
29+
- name: Build and Test
30+
run: mvn clean test post-integration-test
31+
32+
- name: SonarCloud Analysis
33+
if: env.SONAR_TOKEN != ''
34+
env:
35+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
36+
run: mvn sonar:sonar -Dsonar.login=$SONAR_TOKEN

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ releases ]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up JDK 11
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: '11'
17+
distribution: 'temurin'
18+
19+
- name: Cache Maven packages
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.m2/repository
23+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
24+
restore-keys: |
25+
${{ runner.os }}-maven-
26+
27+
- name: Import GPG key
28+
env:
29+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
30+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
31+
run: echo "$GPG_PRIVATE_KEY" | gpg --import --batch --yes
32+
33+
- name: Package and Sign
34+
env:
35+
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
36+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
37+
run: mvn package verify -Prelease -DskipTests=true -Dgpg.keyname=$GPG_KEY_NAME -Dgpg.passphrase=$GPG_PASSPHRASE

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.travis/ipdata-java.crypted.gpg.key

Lines changed: 0 additions & 104 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ipdata-java-client
2-
![Build Status](https://www.travis-ci.org/yassine/ipdata-java-client.svg?branch=master)
2+
![Build Status](https://github.com/ipdata/java/actions/workflows/ci.yml/badge.svg)
33
[![Coverage Status](https://sonarcloud.io/api/project_badges/measure?metric=coverage&project=yassine_ipdata-java-client)](https://sonarcloud.io/dashboard/index/yassine_ipdata-java-client)
44
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?metric=alert_status&project=yassine_ipdata-java-client)](https://sonarcloud.io/dashboard/index/yassine_ipdata-java-client)
55
[![Maintainability](https://sonarcloud.io/api/project_badges/measure?metric=sqale_rating&project=yassine_ipdata-java-client)](https://sonarcloud.io/dashboard/index/yassine_ipdata-java-client)

0 commit comments

Comments
 (0)