-
Notifications
You must be signed in to change notification settings - Fork 8
110 lines (93 loc) · 2.71 KB
/
build.yml
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
103
104
105
106
107
108
109
110
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
# - validate Gradle Wrapper,
# - run test and verifyPlugin tasks,
# - run buildPlugin task and upload artifact
#
# Workflow is triggered on pull_request events.
#
# Docs:
# - GitHub Actions: https://help.github.com/en/actions
name: Build
on:
workflow_call:
inputs:
version:
description: 'Version of the plugin to build'
default: ""
required: false
type: string
pull_request:
push:
branches:
- main
jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation:
name: Gradle Wrapper
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v2
# Run verifyPlugin and test Gradle tasks
test:
name: Test
needs: gradleValidation
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Setup Java 17 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
# Run detekt, ktlint and tests
- name: Run Linters and Test
run: ./gradlew check
# Run verifyPlugin Gradle task
- name: Verify Plugin
run: ./gradlew verifyPlugin
# Build plugin with buildPlugin Gradle task and upload artifact
# Requires test job to be passed
build:
name: Build
needs: test
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Setup Java 17 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
# Build artifact using buildPlugin Gradle task
- name: Build Plugin
run: ./gradlew buildPlugin
# Build unzip plugin to upload it as an artifact
- name: Unzip Plugin
run: unzip ./build/distributions/orion.zip -d unzipped
# Upload plugin artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: orion ${{ inputs.version }}
path: ./unzipped