Skip to content

Commit

Permalink
ci: properly cache gradle (#2150)
Browse files Browse the repository at this point in the history
* ci: properly cache gradle

* ci: try without forcing to use `--distribution-type bin`

* fix: code cleaning
  • Loading branch information
szymonrybczak committed Dec 1, 2023
1 parent 15a88e5 commit 04d6694
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ jobs:
shell: bash
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.0.1

- uses: ruby/setup-ruby@v1
if: runner.os == 'macOS'
Expand Down
11 changes: 10 additions & 1 deletion __e2e__/root.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ afterAll(() => {
cleanup(cwd);
});

test('works when Gradle is run outside of the project hierarchy', () => {
test('works when Gradle is run outside of the project hierarchy', async () => {
/**
* Location of Android project
*/
Expand All @@ -53,6 +53,15 @@ test('works when Gradle is run outside of the project hierarchy', () => {
*/
const gradleWrapper = path.join(androidProjectRoot, 'gradlew');

// Make sure that we use `-bin` distribution of Gradle
await spawnScript(
gradleWrapper,
['wrapper', '--gradle-version=8.0.1', '--distribution-type', 'bin'],
{
cwd: androidProjectRoot,
},
);

// Execute `gradle` with `-p` flag and `cwd` outside of project hierarchy
const {stdout} = spawnScript(gradleWrapper, ['-p', androidProjectRoot], {
cwd: '/',
Expand Down

0 comments on commit 04d6694

Please sign in to comment.