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

     1  name: PR Checks
     2  
     3  defaults:
     4      run:
     5          shell: bash
     6  
     7  permissions:
     8      contents: read
     9  
    10  on:
    11      pull_request:
    12          branches:
    13              - main
    14              - develop
    15      push:
    16          branches:
    17              - main
    18              - develop
    19  concurrency:
    20    group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
    21    cancel-in-progress: true
    22  
    23  jobs:
    24      build:
    25          name: Build
    26          runs-on: client-sdk-linux-medium
    27          steps:
    28              - name: Harden Runner
    29                uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
    30                with:
    31                  egress-policy: audit
    32  
    33              - name: Setup GCC
    34                run: |
    35                  sudo apt-get update
    36                  sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
    37  
    38              - name: Set up Go 1.20
    39                uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
    40                with:
    41                    go-version: "1.20"
    42                id: go
    43  
    44              - name: Check out code into the Go module directory
    45                uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
    46  
    47              - name: Vet Examples
    48                run: go vet ./examples/...
    49  
    50              - name: Vet
    51                run: go vet .
    52  
    53              - name: Build
    54                run: go build -v .
    55  
    56              - name: Lint
    57                uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
    58                with:
    59                    skip-cache: true
    60                    args: --timeout=5m
    61  
    62      test:
    63          name: Unit and Integration Tests
    64          if: success()
    65          runs-on: client-sdk-linux-medium
    66  
    67          needs:
    68              - build
    69          env:
    70            OPERATOR_KEY: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"
    71            OPERATOR_ID: "0.0.2"
    72            HEDERA_NETWORK: "localhost"
    73  
    74          steps:
    75              - name: Harden Runner
    76                uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
    77                with:
    78                    egress-policy: audit
    79  
    80              - name: Setup NodeJS
    81                uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
    82                with:
    83                  node-version: 18
    84  
    85              - name: Setup GCC
    86                run: |
    87                  sudo apt-get update
    88                  sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
    89  
    90              - name: Set up Go 1.20
    91                uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
    92                with:
    93                    go-version: "1.20"
    94                id: go
    95  
    96              - name: Check out code into the Go module directory
    97                uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
    98  
    99              - name: Start the local node
   100                if: success()
   101                run: npx @hashgraph/hedera-local start -d --network local
   102  
   103  
   104              - name: Tests Unit
   105                if: success()
   106                run: go test -tags="unit" -timeout 9999s -v -coverprofile=unit.out -covermode=atomic -race
   107  
   108              - name: Tests Integration
   109                if: success()
   110                run: go test -tags="e2e" -timeout 9999s -v -coverprofile=e2e.out -covermode=atomic -race
   111  
   112              - name: Upload coverage to Codecov
   113                if: success()
   114                uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
   115                with:
   116                  token: ${{ secrets.CODECOV_TOKEN }}
   117                  files: ./unit.out,./e2e.out,./testnets.out
   118  
   119              - name: Stop the local node
   120                run: npx @hashgraph/hedera-local stop
   121  
   122      run-examples:
   123          name: Run Examples
   124          if: success()
   125          runs-on: client-sdk-linux-medium
   126  
   127          needs:
   128              - build
   129          env:
   130            OPERATOR_KEY: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"
   131            OPERATOR_ID: "0.0.2"
   132            HEDERA_NETWORK: "localhost"
   133  
   134          steps:
   135              - name: Harden Runner
   136                uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
   137                with:
   138                    egress-policy: audit
   139  
   140              - name: Setup NodeJS
   141                uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
   142                with:
   143                  node-version: 18
   144  
   145              - name: Setup GCC
   146                run: |
   147                  sudo apt-get update
   148                  sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
   149  
   150              - name: Set up Go 1.20
   151                uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
   152                with:
   153                    go-version: "1.20"
   154                id: go
   155  
   156              - name: Check out code into the Go module directory
   157                uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
   158  
   159              - name: Install Task
   160                run: go install github.com/go-task/task/v3/cmd/task@v3.17.0
   161  
   162              - name: Start the local node
   163                if: success()
   164                run: npx @hashgraph/hedera-local start -d --network local
   165  
   166              - name: Run Examples
   167                if: success()
   168                run: task run-examples
   169  
   170              - name: Stop the local node
   171                run: npx @hashgraph/hedera-local stop