From ca803976062edea52c9f11046fe90bdfb6e46270 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Thu, 3 Oct 2024 15:26:18 -0600 Subject: [PATCH] Test native 1 --- .github/workflows/AsteriskBuildAndCache.yml | 25 ++++++++--- .github/workflows/TestWorkflow.yml | 46 +++++---------------- SetupUbuntuRunner/action.yml | 36 +++++++++------- scripts/setupDatabase.sh | 9 +++- 4 files changed, 60 insertions(+), 56 deletions(-) diff --git a/.github/workflows/AsteriskBuildAndCache.yml b/.github/workflows/AsteriskBuildAndCache.yml index a1e1424..dd09e52 100644 --- a/.github/workflows/AsteriskBuildAndCache.yml +++ b/.github/workflows/AsteriskBuildAndCache.yml @@ -32,6 +32,10 @@ on: type: string default: "" required: false + sipp_version: + required: false + type: string + default: v3.6.1 output_cache_dir: type: string required: false @@ -61,6 +65,7 @@ env: BUILD_SCRIPT: ${{ inputs.build_script }} BUILD_OPTIONS: ${{ inputs.build_options }} MODULES_BLACKLIST: ${{ inputs.modules_blacklist }} + SIPP_VERSION: ${{ inputs.sipp_version }} CACHE_DIR: ${{ github.workspace }}/${{ inputs.output_cache_dir }} REPO_DIR: ${{ github.event.repository.name }} REPO_ORG: ${{ github.event.repository.owner.login }} @@ -69,30 +74,29 @@ env: SCRIPT_DIR: ${{ github.workspace }}/asterisk-ci-actions/scripts BUILD_CACHE_DIR: ${{ github.workspace }}/${{ inputs.build_cache_dir }} BUILD_CACHE_KEY: ${{ inputs.build_cache_key }} - CI_BRANCH: main + CI_BRANCH: main-test-native jobs: Build: name: ${{ inputs.base_branch }}-build runs-on: ubuntu-latest - container: - image: ghcr.io/asterisk/asteriskci-agent-rocky8:latest - options: --privileged defaults: run: shell: bash steps: + - name: Setup Runner + uses: asterisk/asterisk-ci-actions/SetupUbuntuRunner@main-test-native + - name: DumpEnvironment if: ${{ inputs.debug }} uses: asterisk/asterisk-ci-actions/DumpEnvironmentAction@main - name: BuildAsterisk run: | - sysctl -w kernel.core_pattern=/tmp/core-%e-%t - chmod 1777 /tmp echo "*** Cloning ${REPO_ORG}/${ACTION_DIR}" git clone ${GITHUB_SERVER_URL}/${REPO_ORG}/${ACTION_DIR} git -C ${ACTION_DIR} checkout ${CI_BRANCH:-main} + REPO_DIR=$(basename ${ASTERISK_REPO}) mkdir -p ${REPO_DIR} mkdir -p ${CACHE_DIR} @@ -134,6 +138,15 @@ jobs: # We don't care if it fails gh cache delete ${BUILD_CACHE_KEY} || : + - name: BuildSipp + run: | + cd ${GITHUB_WORKSPACE} + git clone ${GITHUB_SERVER_URL}/SIPp/sipp.git + cd sipp + git checkout ${SIPP_VERSION} + ./build.sh --full + install -D -t ${BUILD_CACHE_DIR}/bin sipp + - id: cache-build-output name: CacheBuildProducts uses: actions/cache/save@v4 diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index d59a3f8..ff8c2bb 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -4,38 +4,14 @@ on: workflow_dispatch: jobs: - TestNative: - runs-on: ubuntu-latest - steps: - - name: clone - run: | - echo "Cloning" - git clone -q -b master --depth 10 --no-tags \ - https://x-access-token:${GITHUB_TOKEN}@github.com/asterisk/asterisk asterisk - - name: install - run: | - echo "Running install_prereq install" - cd asterisk - sudo apt update -y - sudo apt install -y binutils-dev doxygen freetds-dev graphviz \ - libasound2-dev libbluetooth-dev libc-client2007e-dev \ - libcap-dev libcfg-dev libcodec2-dev libcorosync-common-dev \ - libcpg-dev libcurl4-openssl-dev libedit-dev libfftw3-dev \ - libgmime-3.0-dev libgsm1-dev libical-dev libiksemel-dev \ - libjack-jackd2-dev libjansson-dev libldap-dev libldap2-dev \ - liblua5.2-dev libneon27-dev libnewt-dev libogg-dev libpopt-dev \ - libradcli-dev libresample1-dev libsndfile1-dev libsnmp-dev \ - libspandsp-dev libspeex-dev libspeexdsp-dev libsrtp2-dev \ - libunbound-dev liburiparser-dev libvorbis-dev libxslt1-dev \ - portaudio19-dev xmlstarlet - echo "Installing addons" - sudo apt install -y sudo python3-dev python3*-venv postgresql \ - git libpcap-dev nano python3-pip alembic odbc-postgresql \ - unixodbc unixodbc-dev python3-psycopg2 - - name: build - run: | - git config --global --add safe.directory $(realpath asterisk) - cd asterisk - ./configure --enable-dev-mode --with-libjwt-bundled - make -j8 - + Build: + uses: ./.github/workflows/AsteriskBuildAndCache.yml + with: + test_type: nightly + asterisk_repo: asterisk/asterisk + pr_number: 931 + base_branch: master + is_cherry_pick: false + build_cache_key: ${{ github.workflow }}-931-master + secrets: + TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/SetupUbuntuRunner/action.yml b/SetupUbuntuRunner/action.yml index 9e467ba..37d5f55 100644 --- a/SetupUbuntuRunner/action.yml +++ b/SetupUbuntuRunner/action.yml @@ -3,22 +3,30 @@ name: SetupUbuntuRunner runs: using: "composite" steps: - - name: "Set kernel.corepattern" + - name: "Set sysctls" shell: bash run: | sudo sysctl -w kernel.core_pattern=/tmp/core-%e-%t - - name: "Enable IPv6" - shell: bash - run: | sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 || : -# docker_exec=$(sed -n -r -e "/^ExecStart/p" /etc/systemd/system/multi-user.target.wants/docker.service) -# cat <<-EOF >/tmp/ipv6.conf -# [Service] -# ExecStart= -# ${docker_exec} --ipv6 --fixed-cidr-v6 "fc00:dead:beef::/64" -# EOF -# sudo mkdir /etc/systemd/system/docker.service.d -# sudo cp /tmp/ipv6.conf /etc/systemd/system/docker.service.d/ipv6.conf -# sudo systemctl daemon-reload -# sudo systemctl restart docker + sudo chmod 1777 /tmp + - name: install_prereqs + shell: bash + run: | + echo "Running install_prereq install" + sudo apt-get update -qq >/dev/null + sudo apt-get install -qq binutils-dev freetds-dev \ + libasound2-dev libbluetooth-dev libc-client2007e-dev \ + libcap-dev libcfg-dev libcodec2-dev libcorosync-common-dev \ + libcpg-dev libcurl4-openssl-dev libedit-dev libfftw3-dev \ + libgmime-3.0-dev libgsm1-dev libical-dev libiksemel-dev \ + libjansson-dev libldap-dev libldap2-dev \ + liblua5.2-dev libneon27-dev libnewt-dev libogg-dev libpopt-dev \ + libradcli-dev libresample1-dev libsndfile1-dev libsnmp-dev \ + libspandsp-dev libspeex-dev libspeexdsp-dev libsrtp2-dev \ + libunbound-dev liburiparser-dev libvorbis-dev libxslt1-dev \ + xmlstarlet >/dev/null + echo "Installing addons" + sudo apt-get install -qq cmake libsctp-dev sudo python3-dev python3*-venv \ + postgresql git libpcap-dev nano python3-pip alembic odbc-postgresql \ + unixodbc unixodbc-dev python3-psycopg2 rsync >/dev/null diff --git a/scripts/setupDatabase.sh b/scripts/setupDatabase.sh index 4f7887f..b786105 100755 --- a/scripts/setupDatabase.sh +++ b/scripts/setupDatabase.sh @@ -4,8 +4,15 @@ echo "Setting up database" SCRIPT_DIR=$(dirname $(readlink -fn $0)) source $SCRIPT_DIR/db.functions +echo " PGSQLCONF: ${PGSQLCONF}" +echo " PGDATA: ${PGDATA}" +echo "PG_VERSION: ${PG_VERSION}" +echo "PGHBA: ${PGHBA}" + +ls -al ${PGDATA} + [ ! -f ${PGDATA}/PG_VERSION ] && { - echo "Initializing database" + echo "Initializing database in ${PGDATA}" _pg_ctl initdb &>/tmp/pg_ctl_initdb.out || { echo "FAILED" cat /tmp/pg_ctl_initdb.out