This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
Merge pull request #303 from mspasiano/main #600
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: CI | |
on: [ push, pull_request, workflow_dispatch ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Gradle wrapper validation | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Set up Zulu JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Build with Gradle | |
if: github.ref != 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
export CORE_CONDUCTOR_VERSION=$(./gradlew conductor-workflow-event-listener:dependencies | grep conductor-core | grep ">" | tail -1 | cut -d '>' -f 2 | cut -d ' ' -f 2) | |
echo "Building against Conductor core version $CORE_CONDUCTOR_VERSION" | |
./gradlew build --scan -x test | |
- name: Build and Publish snapshot | |
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
run: | | |
echo "Running build for commit ${{ github.sha }}" | |
./gradlew build snapshot --scan | |
env: | |
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }} | |
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }} | |
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }} | |
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }} | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v1 | |
if: always() | |
with: | |
comment_on_pr: false | |
files: './**/**/test-results/**/*.xml' | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: '**/build/reports' | |
- name: Store Buildscan URL | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-scan | |
path: 'buildscan.log' | |