migrate jenkins ci to GH actions #9
Workflow file for this run
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
name: Sift Java CI | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }} | |
API_KEY: ${{ secrets.API_KEY }} | |
GITHUBCLONEKEY: ${{ secrets.GITHUBCLONEKEY }} | |
GRADLE_OPTS: -Dorg.gradle.project.sonatypeUsername=username -Dorg.gradle.project.sonatypePassword=password | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
distribution: 'zulu' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 # v3.1.0 | |
- name: Build with Gradle Wrapper | |
run: ./gradlew dependencies | |
- name: Gradle Test | |
run: ./gradlew test | |
java_integration: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
distribution: 'zulu' | |
- name: Clone sift-java-integration-app and extract sift-java | |
uses: actions/checkout@v1 | |
with: | |
repository: SiftScience/sift-java-integration-app | |
token: ${{ secrets.GITHUBCLONEKEY }} | |
- name: Build with Gradle Wrapper | |
run: | | |
cd sift-java-integration-app | |
version=$(./gradlew properties -q | grep -E "^version:" | awk '{print $2}') | |
unzip -j ../build/distributions/sift-java-${version}.zip -d app/libs/ |