fix(ci): make test job depend on build to resolve SNAPSHOT artifacts#2320
Merged
Merged
Conversation
The test job runs with -Ptest profile which disables assembly packaging (install-kar, package phases set to none). This means artifacts like apache-karaf:tar.gz are never built during the test job. Previously, build and test ran as independent parallel jobs on separate runners, so the test job could not resolve these SNAPSHOT artifacts. Fix by: - Adding needs: build to make test run after build completes - Saving the Maven local repository from build via actions/cache/save - Restoring it in the test job via actions/cache/restore - Removing clean from the test Maven command so local repo is preserved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
testjob uses the-PtestMaven profile which disables assembly packaging (install-kar,packagephases set tonone), meaning artifacts likeapache-karaf:tar.gzare never built during the test runbuildandtestran as independent parallel jobs on separate runners, so thetestjob could not resolve these SNAPSHOT artifacts from~/.m2/repositoryservices/interceptor/implto fail with:Could not find artifact org.apache.karaf:apache-karaf:tar.gz:4.4.10-SNAPSHOTFix
needs: buildso the test job runs after build completesactions/cache/savewith a run-scoped keyactions/cache/restorecleanfrom the test Maven command to preserve the restored local repoTest plan
buildjob completes and caches~/.m2/repositorytestjob restores the cache and resolvesapache-karaf:tar.gzsuccessfully