Skip to content

gradle usage

gradle usage #842

Workflow file for this run

name: CI Tests
on: [push]
jobs:
build-verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Fetch Tags
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
if: "!contains(github.ref, 'refs/tags')"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build -Porg.gradle.dependency.verification.console=verbose --dependency-verification strict
- uses: actions/upload-artifact@v4
if: failure()
with:
name: dependency-verification
path: build/reports/dependency-verification/
deb_install_tests:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
jdk: [ "openjdk-11-jdk","openjdk-17-jdk","openjdk-21-jdk" ]
ubuntu: ["20.04", "22.04"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Fetch Tags
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
if: "!contains(github.ref, 'refs/tags')"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Initialize Gradle
run: ./gradlew version --dependency-verification off
- name: Get RPM Version
id: get_rpm_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet --dependency-verification off | sed 's/-/./') && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: mkdirs
run: mkdir -p rd-cli-tool/build/distributions
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: rundeck.deb
path: rd-cli-tool/build/distributions/rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
- name: deb/rpm install test
run: bash scripts/install-test.sh -deb
env:
UBUNTUVERS: ${{matrix.ubuntu}}
DEBJDK: ${{matrix.jdk}}
DEBFILE: rd-cli-tool/build/distributions/rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Fetch Tags
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
if: "!contains(github.ref, 'refs/tags')"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --dependency-verification off
- name: Integration tests
run: ./gradlew integrationTest --dependency-verification off
- uses: actions/upload-artifact@v4
if: failure()
with:
name: integration-test-report
path: integration-tests/build/reports/tests/integrationTest
# - name: deb/rpm install test
# run: bash scripts/install-test.sh
- name: rpm upgrade test
run: bash scripts/rpm-upgrade.sh
- name: Get Release Version
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet --dependency-verification off) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Get RPM Version
id: get_rpm_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet --dependency-verification off | sed 's/-/./') && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Upload zip
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rd-${{ steps.get_version.outputs.VERSION }}.zip
# Directory containing files to upload
path: rd-cli-tool/build/distributions/rd-${{ steps.get_version.outputs.VERSION }}.zip
- name: Upload rpm
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rundeck-cli-${{ steps.get_rpm_version.outputs.VERSION }}-1.noarch.rpm
# Directory containing files to upload
path: rd-cli-tool/build/distributions/rundeck-cli-${{ steps.get_rpm_version.outputs.VERSION }}-1.noarch.rpm
- name: Upload deb
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
# Directory containing files to upload
path: rd-cli-tool/build/distributions/rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
- name: Upload deb-basic
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rundeck.deb
# Directory containing files to upload
path: rd-cli-tool/build/distributions/rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
- name: Upload all-jar
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rundeck-cli-${{ steps.get_version.outputs.VERSION }}-all.jar
# Directory containing files to upload
path: rd-cli-tool/build/libs/rundeck-cli-${{ steps.get_version.outputs.VERSION }}-all.jar
- name: Upload api-lib
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rd-api-client-${{ steps.get_version.outputs.VERSION }}.jar
# Directory containing files to upload
path: rd-api-client/build/libs/rd-api-client-${{ steps.get_version.outputs.VERSION }}.jar
- name: Upload rd-cli-lib
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rd-cli-lib-${{ steps.get_version.outputs.VERSION }}.jar
# Directory containing files to upload
path: rd-cli-lib/build/libs/rd-cli-lib-${{ steps.get_version.outputs.VERSION }}.jar