Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tchatziperis committed May 27, 2024
1 parent 0755586 commit b7bf16c
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 47 deletions.
101 changes: 72 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ jobs:
steps:
- name: Checkout project sources
uses: actions/checkout@v4
- uses: actions/setup-java@v3

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle Wrapper
uses: gradle/[email protected]
uses: gradle/actions/wrapper-validation@v3

- name: Gradle Setup
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
arguments: build
Expand All @@ -36,52 +39,87 @@ jobs:
permissions:
contents: read
steps:
- name: Checkout project source code
- name: Checkout the code
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle Wrapper
uses: gradle/[email protected]
uses: gradle/actions/wrapper-validation@v3

- name: Gradle Setup
uses: gradle/actions/setup-gradle@v3
with:
arguments: test --full-stacktrace

android-tests:
runs-on: macos-latest
runs-on: ubuntu-latest
timeout-minutes: 35
needs: [ build-gradle, unit-tests ]
strategy:
matrix:
include:
- api-level: 28
target: default
arch: x86
- api-level: 33
target: google_apis # emulator API 33 only exists with Google APIs
arch: x86_64
api-level: [ 26,33 ]
target: [ google_apis ]
arch: [ x86_64 ]
permissions:
contents: read
steps:
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Checkout the code
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3

- name: Gradle Setup
uses: gradle/actions/setup-gradle@v3

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run android tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
script: ./gradlew $GRADLE_OPTS connectedCheck --stacktrace
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedCheck --stacktrace

publish-to-snapshot:
name: Publish SNAPSHOT to sonatype.org
Expand All @@ -93,16 +131,21 @@ jobs:
contents: read
packages: write
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- uses: actions/setup-java@v3

- name: Checkout the code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: 17
distribution: "temurin"

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3

- name: Publish with Gradle Wrapper
uses: gradle/gradle-build-action@v3.1.0
uses: gradle/actions/setup-gradle@v3
with:
arguments: publishAllPublicationsToMavenCentral --full-stacktrace
env:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/dependencycheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
branches-ignore:
- 'dependabot/**'
workflow_dispatch:

jobs:
SCA_caller:
uses: eu-digital-identity-wallet/eudi-infra-ci/.github/workflows/sca_bt.yml@main
secrets:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
DOJO_TOKEN: ${{ secrets.DOJO_TOKEN }}
DOJO_URL: ${{ secrets.DOJO_URL }}
SCA_caller:
uses: eu-digital-identity-wallet/eudi-infra-ci/.github/workflows/sca_bt.yml@main
secrets:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
DOJO_TOKEN: ${{ secrets.DOJO_TOKEN }}
DOJO_URL: ${{ secrets.DOJO_URL }}
8 changes: 4 additions & 4 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
Secret_Scanning_caller:
uses: eu-digital-identity-wallet/eudi-infra-ci/.github/workflows/secretscanning.yml@main
secrets:
DOJO_TOKEN: ${{ secrets.DOJO_TOKEN }}
DOJO_URL: ${{ secrets.DOJO_URL }}
uses: eu-digital-identity-wallet/eudi-infra-ci/.github/workflows/secretscanning.yml@main
secrets:
DOJO_TOKEN: ${{ secrets.DOJO_TOKEN }}
DOJO_URL: ${{ secrets.DOJO_URL }}
14 changes: 7 additions & 7 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
workflow_dispatch:

jobs:
SAST_caller:
uses: eu-digital-identity-wallet/eudi-infra-ci/.github/workflows/sast_bt_testDebugUnitTestCoverage.yml@main
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOJO_TOKEN: ${{ secrets.DOJO_TOKEN }}
DOJO_URL: ${{ secrets.DOJO_URL }}
SAST_caller:
uses: eu-digital-identity-wallet/eudi-infra-ci/.github/workflows/sast_bt_testDebugUnitTestCoverage.yml@main
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOJO_TOKEN: ${{ secrets.DOJO_TOKEN }}
DOJO_URL: ${{ secrets.DOJO_URL }}

0 comments on commit b7bf16c

Please sign in to comment.