Repository navigation
130 lines (122 loc) · 4.36 KB
/
Copy pathmaven-args.yml
File metadata and controls
130 lines (122 loc) · 4.36 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
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
name: Maven download progress / MAVEN_ARGS (#1053)
# Verifies the new `show-download-progress` input, which controls whether the
# action injects `-ntp` (--no-transfer-progress) into MAVEN_ARGS.
# - default / false -> MAVEN_ARGS contains -ntp (quiet transfer logs)
# - true -> MAVEN_ARGS is left untouched
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
baseline-no-maven-args:
name: 'BASELINE v5.4.0: MAVEN_ARGS has no -ntp (${{ matrix.os }})'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 (published)
with:
distribution: temurin
java-version: '21'
- name: Assert MAVEN_ARGS does NOT contain -ntp (previous behavior)
shell: bash
run: |
set -euo pipefail
echo "MAVEN_ARGS='${MAVEN_ARGS:-}'"
case " ${MAVEN_ARGS:-} " in
*" -ntp "*) echo "::error::v5.4.0 unexpectedly set -ntp"; exit 1 ;;
*) echo "OK (baseline): no -ntp, as expected for v5.4.0" ;;
esac
default-suppresses-progress:
name: default -> MAVEN_ARGS has -ntp (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: temurin
java-version: '21'
- name: Assert MAVEN_ARGS contains -ntp
shell: bash
run: |
set -euo pipefail
echo "MAVEN_ARGS='${MAVEN_ARGS:-}'"
case " ${MAVEN_ARGS:-} " in
*" -ntp "*) echo "OK: -ntp present" ;;
*) echo "::error::MAVEN_ARGS did not contain -ntp"; exit 1 ;;
esac
explicit-false-suppresses-progress:
name: show-download-progress=false -> -ntp (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: temurin
java-version: '21'
show-download-progress: false
- name: Assert MAVEN_ARGS contains -ntp
shell: bash
run: |
set -euo pipefail
echo "MAVEN_ARGS='${MAVEN_ARGS:-}'"
case " ${MAVEN_ARGS:-} " in
*" -ntp "*) echo "OK: -ntp present" ;;
*) echo "::error::MAVEN_ARGS did not contain -ntp"; exit 1 ;;
esac
explicit-true-keeps-progress:
name: show-download-progress=true -> no -ntp (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: temurin
java-version: '21'
show-download-progress: true
- name: Assert MAVEN_ARGS does NOT contain -ntp
shell: bash
run: |
set -euo pipefail
echo "MAVEN_ARGS='${MAVEN_ARGS:-}'"
case " ${MAVEN_ARGS:-} " in
*" -ntp "*) echo "::error::MAVEN_ARGS unexpectedly contained -ntp"; exit 1 ;;
*) echo "OK: -ntp absent" ;;
esac
real-maven-build-is-quiet:
name: real mvn build has no transfer progress (ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: temurin
java-version: '21'
- name: Build sample project and check logs
working-directory: maven-sample-project
shell: bash
run: |
set -euo pipefail
echo "MAVEN_ARGS='${MAVEN_ARGS:-}'"
# Force dependency downloads so transfer-progress would show if enabled.
rm -rf "$HOME/.m2/repository/org/apache/commons/commons-lang3" || true
mvn -B compile 2>&1 | tee build.log
if grep -E "Progress \(1\):|[0-9]+/[0-9]+ [kKmM]B" build.log; then
echo "::error::Transfer progress lines found despite -ntp"
exit 1
fi
echo "OK: no transfer progress lines in build log"