-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (81 loc) · 2.7 KB
/
smoke-test.yaml
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
##
# Copyright (C) 2024 Hedera Hashgraph, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
name: "Smoke Test"
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- "*"
defaults:
run:
shell: bash
env:
GRADLE_EXEC: ./gradlew
permissions:
contents: read
jobs:
smoke-test:
name: "Smoke Tests"
runs-on: block-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Expand Shallow Clone for Spotless
run: |
if [ -f .git/shallow ]; then
git fetch --unshallow --no-recurse-submodules
else
echo "Repository is not shallow, no need to unshallow."
fi
- name: Set up JDK 21
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: "temurin"
java-version: "21.0.4"
- name: Install grpcurl
run: |
curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz -o grpcurl.tar.gz
sudo tar -xzf grpcurl.tar.gz -C /usr/local/bin grpcurl
rm grpcurl.tar.gz
- name: Cache Gradle packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Start the Smoke Test Container
run: ${{ env.GRADLE_EXEC }} startDockerContainerSmokeTest
- name: Run Smoke Tests
working-directory: server/src/test/resources/
run: ./smoke-test.sh
- name: Stop Smoke Test Container
if: always()
run: ${{ env.GRADLE_EXEC }} stopDockerContainer
- name: Print Server Container Logs
if: always()
run: docker logs block-node-server