Hedera Services Main #1185
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
name: Hedera Services Main | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: read | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: client-sdk-linux-medium | |
strategy: | |
matrix: | |
version: [ 'current', 'latest' ] | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- name: Setup NodeJS | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: 18 | |
# Set up Gradle with Caching Enabled | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0 | |
- name: Setup Java | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup GCC | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev | |
- name: Set up Go 1.20 | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version: "1.20" | |
id: go | |
- name: Fetch Hedera Services | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
repository: hashgraph/hedera-services | |
path: hedera-services | |
- name: Fetch Hedera SDK | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
path: hedera-sdk-go | |
- name: Get Current Tag | |
working-directory: hedera-services | |
if: ${{ matrix.version == 'current' }} | |
run: | | |
git tag MASTER | |
echo "TAG=MASTER" >> .env | |
echo "TAG=MASTER" >> $GITHUB_ENV | |
- name: Get Latest Tag | |
if: ${{ matrix.version == 'latest' }} | |
working-directory: hedera-services | |
run: | | |
git fetch --unshallow --tags | |
export TAG=$(git log --tags --simplify-by-decoration --pretty="format:%d" | grep "^\s(tag:\sv[0-9]\+\.[0-9]\+\.[0-9]\+\(-[A-Za-z0-9]\+\(\.[0-9]\+\)\?\)\?)\$" | head -n 1 | sed -e "s#\s(tag:\s\(.*\))#\1#g") | |
echo "TAG=$TAG" > .env | |
echo "TAG=$TAG" > $GITHUB_ENV | |
- name: Build Hedera Services | |
working-directory: hedera-services | |
run: docker build -t services-node:$TAG . | |
- name: Run Hedera SDK Tests | |
env: | |
OPERATOR_KEY: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137" | |
OPERATOR_ID: "0.0.2" | |
HEDERA_NETWORK: "localhost" | |
run: | | |
cd hedera-services | |
docker-compose up & | |
cd ../hedera-sdk-go | |
go test -tags="e2e" -coverprofile=coverage.out -covermode=atomic -v -timeout 9999s | |
- name: Codecov | |
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true |