From 85e28bb657acd48b7c45d3bd3e90dc598c6e9d58 Mon Sep 17 00:00:00 2001 From: InterLinked1 <24227567+InterLinked1@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:38:27 +0000 Subject: [PATCH] CI: Add GitHub Action CI. --- .github/workflows/main.yml | 44 ++++++++++++++++++++++++++++++++++++++ rpt_install.sh | 5 +++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c9abbcd --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,44 @@ +name: CI + +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: + vm: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a set of commands using the runners shell + - name: Start build + run: echo Beginning build + container: + runs-on: ubuntu-latest + container: debian:12 + steps: + - name: Build Asterisk + run: | + cd /usr/src + apt-get update -y + apt-get install -y wget + wget https://docs.phreaknet.org/script/phreaknet.sh + chmod +x phreaknet.sh + ./phreaknet.sh make + phreaknet update + phreaknet install --lightweight + /etc/init.d/asterisk restart + sleep 3 + - name: Checkout + uses: actions/checkout@v2 + - name: Build app_rpt + run: | + ./rpt_install.sh diff --git a/rpt_install.sh b/rpt_install.sh index 3853123..200c109 100755 --- a/rpt_install.sh +++ b/rpt_install.sh @@ -148,6 +148,11 @@ make -j$(nproc) apps make -j$(nproc) channels make install +# Compilation failed +if [ $? -ne 0 ]; then + exit $? +fi + # If the rpt sounds don't exist yet, add them if [ ! -d /var/lib/asterisk/sounds/en/rpt ]; then printf "RPT sounds don't exist yet, adding them now...\n"