-
Notifications
You must be signed in to change notification settings - Fork 159
102 lines (87 loc) · 3.68 KB
/
main.yml
File metadata and controls
102 lines (87 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Perform a Gradle `build` which includes `assemble`, `check`, `test` of the projects.
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Check the integrity of the Gradle Wrapper executables and lint workflows
lint-and-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- name: Lint GitHub Actions
uses: abcxyz/actions/.github/actions/lint-github-actions@e32ec3bd6af6d87d79fe7c441f435eb7ad11d527 # main
- name: Ratchet Check
uses: sethvargo/ratchet@8b4ca256dbed184350608a3023620f267f0a5253 # main
with:
files: .github/workflows/*.yml
# This workflow contains a single job called "build"
build:
needs: lint-and-check
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Runs this job in parallel for each sub-project
strategy:
matrix:
project-dir:
- strict-version-matcher-plugin
- google-services-plugin
- oss-licenses-plugin
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
with:
dependency-graph: generate-and-submit
# Runs a build which includes `check` and `test` tasks
- name: Perform a Gradle build
run: ./gradlew build
working-directory: ./${{ matrix.project-dir }}
# Publish the plugin to a local repo for testapp verification
- name: Publish to local repo
if: matrix.project-dir == 'oss-licenses-plugin'
run: ./gradlew publish
working-directory: ./oss-licenses-plugin
# Upload the built plugin as an artifact
- name: Upload local repo artifact
if: matrix.project-dir == 'oss-licenses-plugin'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea23f011fb03a537e76e993c2 # v4.4.3
with:
name: oss-licenses-local-repo
path: oss-licenses-plugin/build/repo/
# Job to run high-signal tests using the standalone testapp.
testapp-verification:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download local repo artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: oss-licenses-local-repo
path: oss-licenses-plugin/build/repo/
- name: Set up JDK 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- name: Run Test App Tests
run: ./gradlew build
working-directory: oss-licenses-plugin/testapp