66on :
77 # Triggers the workflow on push or pull request events but only for the main branch
88 push :
9- branches : [ main ]
9+ branches : [main]
1010 pull_request :
11- branches : [ main ]
1211
1312 # Allows you to run this workflow manually from the Actions tab
1413 workflow_dispatch :
@@ -19,46 +18,139 @@ jobs:
1918 lint-and-check :
2019 runs-on : ubuntu-latest
2120 steps :
22- - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@ v6.0.2
2322 - name : Validate Gradle Wrapper
24- uses : gradle/actions/wrapper-validation@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
23+ uses : gradle/actions/wrapper-validation@0723195856401067f7a2779048b490ace7a47d7c # ratchet:gradle/actions/wrapper-validation@ v5.0.2
2524 - name : Lint GitHub Actions
26- uses : abcxyz/actions/.github/actions/lint-github-actions@e32ec3bd6af6d87d79fe7c441f435eb7ad11d527 # main
25+ uses : abcxyz/actions/.github/actions/lint-github-actions@e32ec3bd6af6d87d79fe7c441f435eb7ad11d527 # ratchet:abcxyz/actions/.github/actions/lint-github-actions@ main
2726 - name : Ratchet Check
28- uses : sethvargo/ratchet@8b4ca256dbed184350608a3023620f267f0a5253 # main
27+ uses : sethvargo/ratchet@8b4ca256dbed184350608a3023620f267f0a5253 # ratchet:sethvargo/ratchet@ main
2928 with :
3029 files : .github/workflows/*.yml
3130
32- # This workflow contains a single job called "build"
31+ # Build the simple plugins (no special test infrastructure needed)
3332 build :
3433 needs : lint-and-check
35- # The type of runner that the job will run on
3634 runs-on : ubuntu-latest
37-
38- # Runs this job in parallel for each sub-project
3935 strategy :
4036 matrix :
4137 project-dir :
4238 - strict-version-matcher-plugin
4339 - google-services-plugin
44- - oss-licenses-plugin
45-
46- # Steps represent a sequence of tasks that will be executed as part of the job
4740 steps :
48- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
49- - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
41+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6.0.2
42+
5043 - name : Set up JDK 17
51- uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
44+ uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@ v5.2.0
5245 with :
5346 java-version : ' 17'
5447 distribution : ' temurin'
5548
5649 - name : Setup Gradle
57- uses : gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
50+ uses : gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # ratchet:gradle/actions/setup-gradle@ v5.0.2
5851 with :
5952 dependency-graph : generate-and-submit
6053
61- # Runs a build which includes `check` and `test` tasks
6254 - name : Perform a Gradle build
6355 run : ./gradlew build
6456 working-directory : ./${{ matrix.project-dir }}
57+
58+ # Build and test the oss-licenses plugin, then publish for downstream jobs.
59+ oss-licenses-build :
60+ needs : lint-and-check
61+ runs-on : ubuntu-latest
62+ steps :
63+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6.0.2
64+
65+ - name : Set up JDK 17
66+ uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5.2.0
67+ with :
68+ java-version : ' 17'
69+ distribution : ' temurin'
70+
71+ - name : Set up JDK 21
72+ uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5.2.0
73+ with :
74+ java-version : ' 21'
75+ distribution : ' temurin'
76+
77+ - name : Setup Gradle
78+ uses : gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # ratchet:gradle/actions/setup-gradle@v5.0.2
79+ with :
80+ dependency-graph : generate-and-submit
81+
82+ - name : Build and test
83+ run : ./gradlew build
84+ working-directory : ./oss-licenses-plugin
85+
86+ - name : Publish to local repo
87+ run : ./gradlew publish
88+ working-directory : ./oss-licenses-plugin
89+
90+ - name : Upload local repo artifact
91+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4.6.2
92+ with :
93+ name : oss-licenses-local-repo
94+ path : oss-licenses-plugin/build/repo/
95+
96+ # Verify the plugin works with the standalone testapp.
97+ oss-licenses-testapp :
98+ needs : oss-licenses-build
99+ runs-on : ubuntu-latest
100+ steps :
101+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6.0.2
102+
103+ - name : Download local repo artifact
104+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4.3.0
105+ with :
106+ name : oss-licenses-local-repo
107+ path : oss-licenses-plugin/build/repo/
108+
109+ - name : Set up JDK 21
110+ uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5.2.0
111+ with :
112+ java-version : ' 21'
113+ distribution : ' temurin'
114+
115+ - name : Setup Gradle
116+ uses : gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # ratchet:gradle/actions/setup-gradle@v5.0.2
117+
118+ - name : Build testapp
119+ run : ./gradlew build -PusePublishedPluginFrom=../build/repo
120+ working-directory : oss-licenses-plugin/testapp
121+
122+ # Configuration cache verification for the oss-licenses plugin.
123+ # Expected to FAIL until the plugin's CC bug is fixed (PR #381).
124+ oss-licenses-testapp-cc :
125+ needs : oss-licenses-build
126+ runs-on : ubuntu-latest
127+ continue-on-error : true
128+ steps :
129+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6.0.2
130+
131+ - name : Download local repo artifact
132+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4.3.0
133+ with :
134+ name : oss-licenses-local-repo
135+ path : oss-licenses-plugin/build/repo/
136+
137+ - name : Set up JDK 21
138+ uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5.2.0
139+ with :
140+ java-version : ' 21'
141+ distribution : ' temurin'
142+
143+ - name : Setup Gradle
144+ uses : gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # ratchet:gradle/actions/setup-gradle@v5.0.2
145+
146+ - name : Build testapp (prime configuration cache)
147+ run : ./gradlew build -PusePublishedPluginFrom=../build/repo
148+ working-directory : oss-licenses-plugin/testapp
149+
150+ - name : Clean testapp outputs
151+ run : ./gradlew clean -PusePublishedPluginFrom=../build/repo
152+ working-directory : oss-licenses-plugin/testapp
153+
154+ - name : Rebuild testapp (verify configuration cache reuse)
155+ run : ./gradlew build -PusePublishedPluginFrom=../build/repo
156+ working-directory : oss-licenses-plugin/testapp
0 commit comments