-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Integrated example project for Mill into CI task #22702
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
Merged
wing328
merged 5 commits into
OpenAPITools:master
from
lostiniceland:mill-plugin-cleanup
Jan 18, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
78b9b17
Integrated example project for Mill into CI task
lostiniceland 673f714
Add coursier cache to actions-cache
lostiniceland e8b6c02
Split Mill tests into separate steps
lostiniceland 161084e
try to exclude problematic dependencies from maven-cache so they are …
lostiniceland 041488b
clear m2-cache prior to mill execution
lostiniceland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: Mill plugin tests | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - modules/openapi-generator-mill-plugin/** | ||
| pull_request: | ||
| paths: | ||
| - modules/openapi-generator-mill-plugin/** | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Mill plugin tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Set up JDK 11 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: 11 | ||
| distribution: 'temurin' | ||
| - name: Restore cache (read-only) | ||
| # only use restore keys, no save key because we need to clear the cache before running the examples | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: | | ||
| ~/.m2/repository | ||
| ~/.gradle | ||
| ~/.cache/coursier | ||
| !~/.gradle/caches/*/plugin-resolution/ | ||
| !~/.m2/repository/org/openapitools/ | ||
| !~/.cache/coursier/v1/https/repo1.maven.org/maven2/org/openapitools/ | ||
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
|
|
||
| - name: Maven Clean Install | ||
| env: | ||
| GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
| run: | | ||
| ./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true | ||
|
|
||
| # This is needed because of differences in how Maven and Coursier download artifacts | ||
| # Maven will only download the pom when the transitive dependency is not needed in the current projects compile classpath | ||
| # whereas Coursier expects the artifact (jar) to be present in a Maven repository. When Coursier encounters a | ||
| # artifact folder with a pom it considers the artifact to be available and will then crash when the jar is missing. | ||
| - name: Clear m2 cache except openapitools (because otherwise coursier will fail to resolve artifacts where only poms are downloaded) | ||
| run: | | ||
| mv ~/.m2/repository/org/openapitools /tmp/openapitools-backup || true | ||
| rm -rf ~/.m2/repository/* | ||
| mkdir -p ~/.m2/repository/org | ||
| mv /tmp/openapitools-backup ~/.m2/repository/org/openapitools || true | ||
|
|
||
| - name: Mill Example - Test Validation Command | ||
| env: | ||
| GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
| run: | | ||
| (cd modules/openapi-generator-mill-plugin/example/ && ./mill validateOpenapiSpec $(pwd)/api/petstore-invalid.yaml) | ||
|
|
||
| - name: Mill Example - Test Validation Task | ||
| env: | ||
| GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
| run: | | ||
| (cd modules/openapi-generator-mill-plugin/example/ && ./mill openapi.validate) | ||
|
|
||
| - name: Mill Example - Test Compile Task | ||
| env: | ||
| GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
| run: | | ||
| (cd modules/openapi-generator-mill-plugin/example/ && ./mill __.compile) | ||
|
|
||
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
modules/openapi-generator-mill-plugin/example/mill-build/build.mill
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
|
|
||
| import coursier.LocalRepositories.Dangerous | ||
| import coursier.Repositories | ||
| import mill.scalalib.DepSyntax | ||
| import mill.* | ||
| import mill.api.Task | ||
| import mill.meta.MillBuildRootModule | ||
| import java.util.Properties | ||
| import java.io.FileInputStream | ||
| import scala.util.Using | ||
|
|
||
| object `package` extends MillBuildRootModule { | ||
|
|
||
| override def repositories = Task { | ||
| Seq( | ||
| // central needed for default deps | ||
| Repositories.central.root, | ||
| // the previously installed snapshot is in local maven | ||
| // see docs on Coursier, why m2 is considered dangerous | ||
| Dangerous.maven2Local.root) | ||
| } | ||
|
|
||
| def propsFile = Task.Source("version.properties") | ||
|
|
||
| def readOpenapiSnapshotVersion: Task[String] = Task { | ||
| val props = new Properties() | ||
| Using(new FileInputStream(propsFile().path.toIO)) { fis => | ||
| props.load(fis) | ||
| props.getProperty("openApiGeneratorVersion") | ||
| }.get | ||
| } | ||
|
|
||
| override def mvnDeps = Seq( | ||
| mvn"org.openapitools:openapi-generator-mill-plugin:${readOpenapiSnapshotVersion()}" | ||
| ) | ||
| } |
3 changes: 3 additions & 0 deletions
3
modules/openapi-generator-mill-plugin/example/mill-build/version.properties
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # RELEASE_VERSION | ||
| openApiGeneratorVersion=7.19.0-SNAPSHOT | ||
| # /RELEASE_VERSION |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
modules/openapi-generator-mill-plugin/mill-test/mill-build/build.mill
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.