Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache Maven Distributions downloaded by the Maven Wrapper #453

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yeikel
Copy link

@yeikel yeikel commented Feb 12, 2023

Related issue : #448

With cache: https://github.com/yeikel/mvn-wrapper-caching-test/actions/runs/4158390216/jobs/7193735589

Without cache : https://github.com/yeikel/mvn-wrapper-caching-test/actions/runs/4158489501/jobs/7193751281

2023-02-12 22:15:22 (4.06 MB/s) - ‘/home/runner/work/mvn-wrapper-caching-test/mvn-wrapper-caching-test/.mvn/wrapper/maven-wrapper.jar’ saved [59925/59925]
[INFO] Apache Maven Wrapper 3.1.1
[INFO] Installing Maven distribution /home/runner/.m2/wrapper/dists/apache-maven-3.8.5-bin/67203e94
[INFO] Downloading https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
[INFO] Unzipping /home/runner/.m2/wrapper/dists/apache-maven-3.8.5-bin/67203e94/apache-maven-3.8.5-bin.zip to /home/runner/.m2/wrapper/dists/apache-maven-3.8.5-bin/67203e94

Cache invalidation after a maven upgrade : https://github.com/yeikel/mvn-wrapper-caching-test/actions/runs/4158550035/jobs/7193847666

@yeikel yeikel requested a review from a team as a code owner February 12, 2023 22:16
@yeikel yeikel force-pushed the cache/mvn-wrapper branch 2 times, most recently from ed43c8e to d6fdbda Compare February 12, 2023 22:25
@yeikel
Copy link
Author

yeikel commented Feb 16, 2023

I am not sure why the "Check dist" is failing. Any help would be appreciated

C:\Users\Yeikel\setup-java>nvm list

  • 16.19.0 (Currently using 64-bit executable)

C:\Users\Yeikel\setup-java>npm ci --ignore-scripts
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

added 407 packages, and audited 408 packages in 4s

25 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

C:\Users\Yeikel\setup-java>npm run build

[email protected] build
ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts

ncc: Version 0.33.4
ncc: Compiling file index.js into CJS
ncc: Using [email protected] (local user-provided)
4165kB dist\setup\index.js
4165kB [6176ms] - ncc 0.33.4
ncc: Version 0.33.4
ncc: Compiling file index.js into CJS
ncc: Using [email protected] (local user-provided)
2800kB dist\cleanup\index.js
2800kB [4451ms] - ncc 0.33.4

C:\Users\Yeikel\setup-java>git status
On branch cache/mvn-wrapper
Your branch is up to date with 'origin/cache/mvn-wrapper'.

nothing to commit, working tree clean

C:\Users\Yeikel\setup-java>

@IvanZosimov
Copy link
Contributor

@yeikel, just tried to rebuild your solution locally on Windows, check the output out:

C:\Users\Desktop\Yeikel\setup-java> git status
On branch cache/mvn-wrapper
Your branch is up to date with 'origin/cache/mvn-wrapper'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   dist/cleanup/index.js
        modified:   dist/setup/index.js

no changes added to commit (use "git add" and/or "git commit -a")

Try to rebuild one more time.

@yeikel
Copy link
Author

yeikel commented Feb 17, 2023

@yeikel, just tried to rebuild your solution locally on Windows, check the output out:

C:\Users\Desktop\Yeikel\setup-java> git status
On branch cache/mvn-wrapper
Your branch is up to date with 'origin/cache/mvn-wrapper'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   dist/cleanup/index.js
        modified:   dist/setup/index.js

no changes added to commit (use "git add" and/or "git commit -a")

Try to rebuild one more time.

It seems that there is a slight difference in how the compiler behaves in Windows compared to Unix

I tried the same build in my Windows machine and it returned no changes. But in my Mac it created 1ec9456

@yeikel
Copy link
Author

yeikel commented Feb 28, 2023

@IvanZosimov Could you please approve the workflow? Hopefully after my latest commits there are no more conflicts

@IvanZosimov IvanZosimov linked an issue Jul 7, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache Maven distribution downloaded by Maven Wrapper
2 participants