github.com/hashgraph/hedera-sdk-go/v2@v2.48.0/.github/workflows/main.yml (about)

     1  name: Hedera Services Main
     2  
     3  defaults:
     4      run:
     5          shell: bash
     6  
     7  permissions:
     8      contents: read
     9  
    10  on:
    11    schedule:
    12      - cron: '0 0 * * *'
    13    workflow_dispatch:
    14  
    15  jobs:
    16    test:
    17      runs-on: client-sdk-linux-medium
    18      strategy:
    19        matrix:
    20          version: [ 'current', 'latest' ]
    21  
    22      steps:
    23        -   name: Harden Runner
    24            uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
    25            with:
    26              egress-policy: audit
    27  
    28        -   name: Setup NodeJS
    29            uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
    30            with:
    31              node-version: 18
    32  
    33        # Set up Gradle with Caching Enabled
    34        -   name: Setup Gradle
    35            uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
    36  
    37        -   name: Setup Java
    38            uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0
    39            with:
    40              distribution: temurin
    41              java-version: 17
    42  
    43        -   name: Setup GCC
    44            run: |
    45                sudo apt-get update
    46                sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
    47  
    48        -   name: Set up Go 1.20
    49            uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
    50            with:
    51              go-version: "1.20"
    52            id: go
    53  
    54        - name: Fetch Hedera Services
    55          uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
    56          with:
    57            repository: hashgraph/hedera-services
    58            path: hedera-services
    59  
    60        -   name: Fetch Hedera SDK
    61            uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
    62            with:
    63                path: hedera-sdk-go
    64  
    65        - name: Get Current Tag
    66          working-directory: hedera-services
    67          if: ${{ matrix.version == 'current' }}
    68          run: |
    69            git tag MASTER
    70            echo "TAG=MASTER" >> .env
    71            echo "TAG=MASTER" >> $GITHUB_ENV
    72  
    73        - name: Get Latest Tag
    74          if: ${{ matrix.version == 'latest' }}
    75          working-directory: hedera-services
    76          run: |
    77            git fetch --unshallow --tags
    78            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")
    79            echo "TAG=$TAG" > .env
    80            echo "TAG=$TAG" > $GITHUB_ENV
    81  
    82        - name: Build Hedera Services
    83          working-directory: hedera-services
    84          run: docker build -t services-node:$TAG .
    85  
    86        - name: Run Hedera SDK Tests
    87          env:
    88            OPERATOR_KEY: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"
    89            OPERATOR_ID: "0.0.2"
    90            HEDERA_NETWORK: "localhost"
    91          run: |
    92            cd hedera-services
    93            docker-compose up &
    94            cd ../hedera-sdk-go
    95            go test -tags="e2e" -coverprofile=coverage.out -covermode=atomic -v -timeout 9999s
    96        - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
    97          with:
    98            token: ${{ secrets.CODECOV_TOKEN }}
    99            fail_ci_if_error: true
   100            verbose: true