#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network Ledger 🥑
run-name: ${{ github.actor }} is running the Test Network Ledger tests 🥑

on:
  workflow_dispatch:
  push:
    branches: [ "main", "release-2.5" ]
  pull_request:
    branches: [ "main", "release-2.5" ]

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  basic:
    runs-on: fabric-ubuntu-20.04
    strategy:
      matrix:
        chaincode-language:
          - go
          - javascript
        chaincode-name:
          - ledger
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Set up the test network runtime
        uses: ./.github/actions/test-network-setup

      - name: Run Test
        working-directory: test-network
        run: ../ci/scripts/run-test-network-ledger.sh
        env:
          CHAINCODE_NAME: ${{ matrix.chaincode-name }}
          CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
