feat: Simulator Base Project #70
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# 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 | |
jobs: | |
smoke-test: | |
name: "Smoke Tests" | |
runs-on: block-node-linux-medium | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.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@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- 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: Build application | |
run: ${{ env.GRADLE_EXEC }} build | |
- name: Run application in background, capture logs in app.log | |
run: | | |
${{ env.GRADLE_EXEC }} run 2> server/src/test/resources/app.log < /dev/null & | |
echo "Application started with PID $APP_PID" | |
sleep 10 | |
- name: Print App Logs | |
run: cat server/src/test/resources/app.log | |
- name: Smoke Test | |
working-directory: server/src/test/resources/ | |
run: ./smoke-test.sh app.log |