Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 49 additions & 7 deletions .github/workflows/javaci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,63 @@
name: Java CI

on: [push]
on:
push:
branches:
- main
- sdk-automation/models
- promote/main
pull_request:
branches:
- main
- sdk-automation/models
- promote/main
workflow_dispatch: {}

permissions:
contents: read

jobs:
build:
java-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '20'
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Check code style
run: mvn -B checkstyle:check --no-transfer-progress

java-test:
runs-on: ubuntu-latest
needs: java-check

strategy:
matrix:
java: [ '11', '17', '20' ]

steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.Java }}
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4

with:
java-version: ${{ matrix.java }}
distribution: 'adopt'

- name: Run the tests with Maven
run: mvn -B clean test package --no-transfer-progress
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Run tests with coverage
run: mvn -B clean test package --no-transfer-progress
17 changes: 8 additions & 9 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Sonarcloud CI

on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]
schedule:
- cron: '0 0 * * 4'
workflow_dispatch: {}

permissions:
contents: read
pull-requests: read

jobs:
SonarCloud-Build:
name: SonarCloud Build
java-sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -40,8 +41,6 @@ jobs:
run: mvn test jacoco:report

- name: Run SonarCloud Analysis
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn sonar:sonar -Dsonar.projectKey=Adyen_adyen-java-api-library