This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
160 lines (152 loc) · 4.29 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: "build-test"
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- develop
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm ci
npm test
test-basic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
servers: '[{"id": "foo", "username": "fu", "password": "bar" }]'
mirrors: '[{ "id": "nexus", "mirrorOf": "!my-org-snapshots,*", "url": "http://redacted/nexus/content/groups/public" }]'
repositories: '[{"id": "foo", "url": "https://fu.bar"}]'
plugin_repositories: '[{"id": "foo-plugin", "url": "https://fu.bar.plugin"}]'
profiles: '[{ "id": "foo.profile", "name": "foo.profile", "url": "http://foo.bar.profile", "properties": { "foo": "property-1", "bar": "property-2"} }]'
plugin_groups: '[ "some.plugin.group.id", "some.other.plugin.group.id" ]'
active_profiles: '[ "foo.profile" ]'
- run: |
cat ~/.m2/settings.xml
test-expanded:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
repositories: >
[
{
"id": "some-repository",
"name": "some-repository-name",
"url": "http://some.repository.url",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "false"
}
}
]
plugin_repositories: >
[
{
"id": "some-plugin-repository",
"name": "some-plugin-repository-name",
"url": "http://some.plugin.repository.url",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "false"
}
}
]
servers: >
[
{
"id": "some-id",
"username": "${env.USER}",
"password": "${env.PASS}",
"configuration": {
"httpConfiguration": {
"all": {
"usePreemptive": "true"
}
}
}
}
]
mirrors: >
[
{
"id": "nexus",
"mirrorOf": "!my-org-snapshots,*",
"url": "http://redacted/nexus/content/groups/public"
}
]
profiles: >
[
{
"id": "foo.profile",
"name": "foo.profile",
"url": "http://foo.bar.profile",
"properties": {
"foo": "property-1",
"bar": "property-2"
}
}
]
plugin_groups: >
[
"some.plugin.group.id",
"some.other.plugin.group.id"
]
active_profiles: >
[
"some-profile"
]
output_file: .m2/settings.xml
- run: |
cat .m2/settings.xml
test-filepath:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
output_file: custom.xml
- run: |
cat custom.xml
test-maven:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
output_file: custom.xml
- run: |
cat custom.xml
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'adopt'
- run: |
cd test/maven;
./mvnw -s ../../custom.xml clean test
test-env-filepath:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
output_file: $GITHUB_WORKSPACE/custom.xml
- run: |
cat $GITHUB_WORKSPACE/custom.xml
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'adopt'
- run: |
cd test/maven;
./mvnw -s $GITHUB_WORKSPACE/custom.xml clean test