All Projects → eskatos → Gradle Command Action

eskatos / Gradle Command Action

Licence: mit
Execute Gradle Command Github Action

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Gradle Command Action

Spring Cloud Microservices Development
Spring Cloud Microservices Development.《Spring Cloud 微服务架构开发实战》
Stars: ✭ 106 (-13.82%)
Mutual labels:  gradle
Godot
Keep track of how much time you spend on Gradle builds
Stars: ✭ 113 (-8.13%)
Mutual labels:  gradle
Anychart Android
AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
Stars: ✭ 1,762 (+1332.52%)
Mutual labels:  gradle
Goomph
IDE as build artifact
Stars: ✭ 108 (-12.2%)
Mutual labels:  gradle
Iron
Fast and easy to use NoSQL data storage with RxJava support
Stars: ✭ 112 (-8.94%)
Mutual labels:  gradle
Liquidrefreshlayout
Liquid Refresh Layout is a simple SwipeToRefresh library that helps you easily integrate SwipeToRefresh and performs simple clean liquid animation
Stars: ✭ 114 (-7.32%)
Mutual labels:  gradle
Gradle Changelog Plugin
Plugin for parsing and managing the Changelog in a "keep a changelog" style.
Stars: ✭ 102 (-17.07%)
Mutual labels:  gradle
Downlords Faf Client
Official client for Forged Alliance Forever
Stars: ✭ 121 (-1.63%)
Mutual labels:  gradle
Marklogic Data Hub
The MarkLogic Data Hub: documentation ==>
Stars: ✭ 113 (-8.13%)
Mutual labels:  gradle
Clojurephant
Clojure and Clojurescript support for Gradle
Stars: ✭ 118 (-4.07%)
Mutual labels:  gradle
Fastdex
🚀 加快 apk 的编译速度 🚀
Stars: ✭ 1,457 (+1084.55%)
Mutual labels:  gradle
Springcloud Quickstart
spring cloud demo based on gradle.
Stars: ✭ 111 (-9.76%)
Mutual labels:  gradle
Okbuck
OkBuck is a gradle plugin that lets developers utilize the Buck build system on a gradle project.
Stars: ✭ 1,513 (+1130.08%)
Mutual labels:  gradle
Webfluxtemplate
Spring Webflux template application with working Spring Security, Web-sockets, Rest, Web MVC, and Authentication with JWT.
Stars: ✭ 107 (-13.01%)
Mutual labels:  gradle
Gnag
A Gradle plugin that helps facilitate GitHub PR checking and automatic commenting of violations.
Stars: ✭ 120 (-2.44%)
Mutual labels:  gradle
Jenkins Pipeline Shared Libraries Gradle Plugin
Gradle plugin to help with build and test of Jenkins Pipeline Shared Libraries (see https://jenkins.io/doc/book/pipeline/shared-libraries/)
Stars: ✭ 103 (-16.26%)
Mutual labels:  gradle
Easy Rating Dialog
A plug and play ;) android library for displaying a "rate this app" dialog
Stars: ✭ 113 (-8.13%)
Mutual labels:  gradle
Gradle Vaadin Plugin
A Gradle plugin for building Vaadin applications
Stars: ✭ 122 (-0.81%)
Mutual labels:  gradle
Shrinker
Inline constant fields of android R class by asm and transform-api
Stars: ✭ 121 (-1.63%)
Mutual labels:  gradle
Android Readthefuckingsourcecode
😜 记录日常的开发技巧,开发中遇到的技术重点、难点,各个知识点的总结,优质面试题等等。持续更新...
Stars: ✭ 1,665 (+1253.66%)
Mutual labels:  gradle

Execute Gradle commands in GitHub Actions workflows

This GitHub Action can be used to run arbitrary Gradle commands on any platform supported by GitHub Actions.

You might also be interested by the related Gradle Plugin that allows your build to easily get GitHub Actions environment and tag Gradle Build Scans accordingly.

Usage

The following workflow will run ./gradlew build using the wrapper from the repository on ubuntu, macos and windows. The only prerequisite is to have Java installed, you can define the version you need to run the build using the actions/setup-java action.

# .github/workflows/gradle-build-pr.yml
name: Run Gradle on PRs
on: pull_request
jobs:
  gradle:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/[email protected]
    - uses: actions/[email protected]
      with:
        java-version: 11
    - uses: eskatos/[email protected]
      with:
        arguments: build

Gradle arguments

The arguments input can used to pass arbitrary arguments to the gradle command line.

Here are some valid examples:

arguments: build
arguments: check --scan
arguments: some arbitrary tasks
arguments: build -PgradleProperty=foo
arguments: build -DsystemProperty=bar
....

See gradle --help for more information.

If you need to pass environment variables, simply use the GitHub Actions workflow syntax:

- uses: eskatos/[email protected]
  env:
    CI: true

Run a build from a different directory

- uses: eskatos/[email protected]
  with:
    build-root-directory: some/subdirectory

Use a Gradle wrapper from a different directory

 - uses: eskatos/[email protected]
   with:
     wrapper-directory: path/to/wrapper-directory

Use a specific gradle executable

 - uses: eskatos/[email protected]
   with:
     gradle-executable: path/to/gradle

Setup and use a declared Gradle version

 - uses: eskatos/[email protected]
   with:
     gradle-version: 6.5

gradle-version can be set to any valid Gradle version.

Moreover, you can use the following aliases:

Alias Selects
wrapper The Gradle wrapper's version (default, useful for matrix builds)
current The current stable release
rc The current release candidate if any, otherwise fallback to current
nightly The latest nightly, fails if none.
release-nightly The latest release nightly, fails if none.

This can be handy to, for example, automatically test your build with the next Gradle version once a release candidate is out:

# .github/workflows/test-gradle-rc.yml
name: Test latest Gradle RC
on:
  schedule:
    - cron: 0 0 * * * # daily
jobs:
  gradle-rc:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - uses: actions/[email protected]
      with:
        java-version: 11
    - uses: eskatos/[email protected]
      with:
        gradle-version: rc
        arguments: build --dry-run # just test build configuration

Caching

This action provides 3 levels of caching to help speed up your GitHub Actions:

  • wrapper caches the local wrapper installation, saving time downloading and unpacking Gradle distributions ;
  • dependencies caches the dependencies, saving time downloading dependencies ;
  • configuration caches the build configuration, saving time configuring the build.

Only the first one, caching the wrapper installation, is enabled by default. Future versions of this action will enable all caching by default.

You can control which level is enabled as follows:

wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true

The wrapper installation cache is simple and can't be configured further.

The dependencies and configuration cache will compute a cache key in a best effort manner. Keep reading to learn how to better control how they work.

Configuring the dependencies and configuration caches

Both the dependencies and configuration caches use the same default configuration:

They use the following inputs to calculate the cache key:

**/*.gradle
**/*.gradle.kts
**/gradle.properties
gradle/**

This is a good enough approximation. They restore cached state even if there isn't an exact match.

If the defaults don't suit your needs you can override them with the following inputs:

dependencies-cache-key: |
  **/gradle.properties
  gradle/dependency-locks/**
dependencies-cache-exact: true
configuration-cache-key: |
  **/gradle.properties
  gradle/dependency-locks/**
configuration-cache-exact: true

Coming up with a good cache key isn't trivial and depends on your build. The above example isn't realistic. Stick to the defaults unless you know what you are doing.

If you happen to use Gradle dependency locking you can make the dependencies cache more precise with the following configuration:

dependencies-cache-enabled: true
dependencies-cache-key: gradle/dependency-locks/**
dependencies-cache-exact: true

Build scans

If your build publishes a build scan the gradle-command-action action will emit the link to the published build scan as an output named build-scan-url.

You can then use that link in subsequent actions of your workflow.

For example:

# .github/workflows/gradle-build-pr.yml
name: Run Gradle on PRs
on: pull_request
jobs:
  gradle:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/[email protected]
    - uses: actions/[email protected]
      with:
        java-version: 11
    - uses: eskatos/[email protected]
      with:
        arguments: build
      id: gradle
    - name: "Comment build scan url"
      uses: actions/[email protected]
      if: github.event_name == 'pull_request' && failure()
      with:
        github-token: ${{secrets.GITHUB_TOKEN}}
        script: |
          github.issues.createComment({
            issue_number: context.issue.number,
            owner: context.repo.owner,
            repo: context.repo.repo,
            body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}'
          })
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].