# This is a basic workflow to help you get started with Actions

name: Alice->Kamailio->Bob

# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    env:
      MM_TYPE: kamailio
      MM_BRANCH: ${{ matrix.mm-branch }}
      RTPP_BRANCH: master
      RTPPC_TYPE: ${{ matrix.rtppc-type }}
      python-version: '3.8'
      PYTHON_CMD: "python3.8"

    strategy:
      matrix:
        mm-branch: ['master', '5.4', '5.3', '5.2', '5.1', '5.0', '4.4', '4.3', '4.2', '4.1']
        rtppc-type: ['unix', 'udp', 'udp6']

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - name: Set up Python ${{ env.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ env.python-version }}

      - name: before_install
        run: |
          echo "+++ hosts orig +++"
          cat /etc/hosts
          echo "--- hosts orig ---"
          sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
          sudo sh -c 'echo >> /etc/hosts; grep "^127.0.0.1" /etc/hosts | sed "s|^127.0.0.1|::1|g" >> /etc/hosts'
          echo "+++ hosts patched +++"
          cat /etc/hosts
          echo "--- hosts patched ---"
          sudo -H DEBIAN_FRONTEND=noninteractive apt-get update
          sudo -H DEBIAN_FRONTEND=noninteractive apt-get install gpp
          sh -x ./install_depends/opensips.sh

      - name: script
        run: sh -x ./test_run.sh

Add Kamailio to the party.
Add Kamailio to the party.
