-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathjava-cloud-bom-bom-content-test.yaml
More file actions
83 lines (81 loc) · 2.99 KB
/
Copy pathjava-cloud-bom-bom-content-test.yaml
File metadata and controls
83 lines (81 loc) · 2.99 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
on:
push:
branches:
- main
pull_request:
name: java-cloud-bom ci
env:
BUILD_SUBDIR: java-cloud-bom
jobs:
filter:
runs-on: ubuntu-latest
outputs:
library: ${{ steps.filter.outputs.library }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
library:
- 'java-cloud-bom/**'
bom-content-test:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
runs-on: ubuntu-latest
if: github.repository_owner == 'googleapis'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
cache: maven
- run: java -version
- name: Pre-install all BOM modules to populate local cache
run: |
for f in $(find . -mindepth 2 -name "pom.xml" | grep "\-bom/pom.xml" | grep -v "samples" | grep -v "/tests/" | grep -v "/resources/"); do
grep -q "<packaging>pom</packaging>" "$f" && echo "$f"
done | sed 's|^\./||' | sed 's|/pom.xml$||' | tr '\n' ',' | sed 's/,$//' > bom_projects.txt
mvn install -pl $(cat bom_projects.txt) -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
rm bom_projects.txt
shell: bash
- name: Install BOMs
run: |
mvn -B -V -ntp install -f java-cloud-bom/pom.xml
- name: Ensure the members of the Libraries BOM exist in Maven Central
uses: ./java-cloud-bom/tests/validate-bom
with:
bom-path: java-cloud-bom/libraries-bom/pom.xml
- name: Ensure the BOM has valid content (at releases)
if: github.head_ref == 'release-please--branches--main'
run: |
mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBom"
working-directory: java-cloud-bom/tests
bom-assertion-test:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
name: BomContentAssertionsTest (Test for assertion logic in BomContentTest)
runs-on: ubuntu-latest
if: github.repository_owner == 'googleapis'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 11
- run: java -version
- name: Pre-install all BOM modules to populate local cache
run: |
for f in $(find . -mindepth 2 -name "pom.xml" | grep "\-bom/pom.xml" | grep -v "samples" | grep -v "/tests/" | grep -v "/resources/"); do
grep -q "<packaging>pom</packaging>" "$f" && echo "$f"
done | sed 's|^\./||' | sed 's|/pom.xml$||' | tr '\n' ',' | sed 's/,$//' > bom_projects.txt
mvn install -pl $(cat bom_projects.txt) -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
rm bom_projects.txt
shell: bash
- name: Install BOMs
run: |
mvn -B -V -ntp install -f java-cloud-bom/pom.xml
- run: |
mvn -B -V -ntp verify -Dtest="BomContentAssertionsTest"
working-directory: java-cloud-bom/tests