-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.11 KB
/
commit.yml
File metadata and controls
46 lines (36 loc) · 1.11 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
name: Commit Verification
on: push
# Cancel in-progress runs of the same workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
env:
PERSON: Bjarne Stroustrup
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- name: Build with Gradle
run: ORG_GRADLE_PROJECT_entityToGreet="$PERSON" ./gradlew build --refresh-dependencies
- name: Run greet task and verify output
run: |
ORG_GRADLE_PROJECT_entityToGreet="$PERSON" ./gradlew greet | tee output.log
if ! grep -q "$PERSON" output.log; then
echo "Error: Expected '$PERSON' not found in output"
cat output.log
exit 1
fi
echo "Success: Output contains '$PERSON'"