Do not use `gradle/actions/setup-gradle` with `arguments`; replace with two steps
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- github-actions
- Ambito
- ci-cd
Direzione di ricerca
Inizia individuando la recipe che gestisce gli step di gradle/actions/setup-gradle usando il parametro arguments e rivedi gli unit test della recipe. Usa gli esempi YAML prima e dopo come trasformazione prevista, inclusa la gestione di build-root-directory e working-directory. Il lavoro è completato quando le esecuzioni obsolete basate su arguments diventano uno step setup seguito da step run per i comandi Gradle.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What problem are you trying to solve?
Using the action to execute Gradle via the arguments parameter is deprecated
The core functionality of the setup-gradle (and gradle-build-action) actions is to configure your Gradle environment for GitHub Actions. Once the action has run, any subsequent Gradle executions will benefit from caching, reporting and other features of the action.Using the arguments parameter to execute Gradle directly is not necessary to benefit from this action. This input is deprecated, and will be removed in the v4 major release of the action.
To convert your workflows, replace any steps using the arguments parameter with 2 steps: one to setup-gradle and another that runs your Gradle build.
What precondition(s) should be checked before applying this recipe?
Uses gradle/actions/setup-gradle
Describe the situation before applying the recipe
steps:
- name: Assemble the project
uses: gradle/actions/setup-gradle@v3
with:
arguments: 'assemble'
- name: Run the tests
uses: gradle/actions/setup-gradle@v3
with:
arguments: 'test'
- name: Run build in a subdirectory
uses: gradle/actions/setup-gradle@v3
with:
build-root-directory: another-build
arguments: 'build'
Describe the situation after applying the recipe
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Assemble the project
run: ./gradlew assemble
- name: Run the tests
run: ./gradlew test
- name: Run build in a subdirectory
working-directory: another-build
run: ./gradlew build
Any additional context
Using the action in this way gives you more control over how Gradle is executed, while still giving you all of the benefits of the setup-gradle action.
The arguments parameter is scheduled to be removed in setup-gradle@v4.
Note: if you are using the gradle-build-action, see here for more details on how to migrate.
- Lingua principale
- Java
- Stelle
- 1
- Fork
- 9
- Merge medio
- 7h 23m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openrewrite/rewrite-github-actions
-
enhancement recipe
Difficoltà 5/5 Più di una settimana Idoneità per principianti 48/100
openrewrite/rewrite-github-actions#195 · 1 commento ·
-
recipe
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
recipe
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
enhancement recipe
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
openrewrite/rewrite-github-actions#128 · 5 commenti ·
-
recipe
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
openrewrite/rewrite-github-actions#90 · 1 reazione ·
Tutte le issue di openrewrite/rewrite-github-actions
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
scylladb/scylla-cdc-source-connector#350 ·
I maintainer di solito rispondono entro 1 giorno
-
agent:working documentation enhancement go:build lane:needs-decision
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Sanne/incus-spawn#1435 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area:shuffle bug priority:high requires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/datafusion-comet#7062 ·
I maintainer di solito rispondono entro 1 giorno
-
wait for review
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue up-for-grabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
AnikethTS/ChangeRadar#22 ·
I maintainer di solito rispondono entro 1 giorno