Comments (3)
Thanks for reporting. You're correct that the wrapper
version keyword doesn't work using setup-gradle
with a separate build step. This feature is a leftover from the gradle-build-action
which provided a arguments
parameter to directly execute Gradle.
Using gradle-version: wrapper
with setup-gradle
doesn't make sense, since it doesn't download any Gradle version and it doesn't (cannot) update the path so that gradle == ./gradlew
.
In order to use a matrix to execute with multiple Gradle versions (including the wrapper), you'll need to do something like:
jobs:
build:
strategy:
matrix:
gradle-version: ['wrapper', '7.6.4', '8.8']
gradle-command: ['gradle']
include:
- gradle-version: 'wrapper'
gradle-command: './gradlew'
steps:
# ...
- name: "Setup Gradle ${{ matrix.gradle-version }}"
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{ matrix.gradle-version }}
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
build-scan-terms-of-use-agree: "yes"
- name: 'Build'
run: |
${{matrix.gradle-command}} build
This isn't ideal, but it should provide a workaround.
I'll leave this issue open pending a better solution (if possible).
from actions.
Thank you for the workaround, I didn't know about the matrix.include
option. I will try this soon.
I don't know how setup-gradle
works internally, but apparently it can update the PATH to include the downloaded gradle
. So for a wrapper
it could instead inject a small script named gradle
that just calls ./gradlew
in the current directory.
from actions.
for a wrapper it could instead inject a small script named
gradle
that just calls./gradlew
in the current directory.
Yes I thought of that too. I'll see if that would work.
from actions.
Related Issues (20)
- Avoid downloading Gradle when version is pre-installed on runner
- Gradle state from cache not restored from tags HOT 3
- Link to build scans are not reported in Job Summary HOT 3
- Add the July 02 Webinar to the documentation and references
- Support `runs-on/cache` (https://github.com/runs-on/cache) HOT 3
- Does the dependency-submission action support a monorepo configuration?
- Trouble caching build outputs HOT 2
- setup-grade action: Consider using D: drive on Windows Runners to address performance issues HOT 10
- Paths in `gradle-home-cache-excludes` are not honoured when restoring Gradle User Home from cache HOT 3
- Remove deprecated features in preparation for v4
- The `setup-gradle` action should make it easy to run with wrapper in an OS-agnostic way HOT 2
- setup-gradle: GUH cache key collision when used in a reusable workflow HOT 22
- Present summary of Gradle build warnings in Job Summary and PR comment HOT 2
- dependabot creates pull requests for version 4 HOT 4
- Clarify cache cleanup documentation HOT 1
- Could not load from local cache: Timeout waiting to lock Build cache HOT 4
- nvm
- Short-lived access tokens are generated when Develocity injection is not enabled
- 🐞 Actions doesn't see gradle with version 8.10 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actions.