From 34c511208c75ab886378b19d581d42de4920aa0b Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 30 Nov 2020 22:55:02 -0500 Subject: [PATCH] Bionic and Xenial tests work Not sure what PHP version is being used for each, but composer install works on both tests --- .github/scripts/install.sh | 28 +++++++++++++++++ .github/scripts/python-pkg-install.sh | 6 ++++ .github/scripts/python-pkg-test.sh | 12 ++++++++ .github/workflows/test-bionic.yml | 30 +++++++++++++++++++ .../{test-xenial.md => test-xenial.yml} | 14 +++------ 5 files changed, 80 insertions(+), 10 deletions(-) create mode 100644 .github/scripts/install.sh create mode 100644 .github/scripts/python-pkg-install.sh create mode 100644 .github/scripts/python-pkg-test.sh create mode 100644 .github/workflows/test-bionic.yml rename .github/workflows/{test-xenial.md => test-xenial.yml} (58%) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh new file mode 100644 index 000000000..751987497 --- /dev/null +++ b/.github/scripts/install.sh @@ -0,0 +1,28 @@ +#/bin/bash + +add-apt-repository -y ppa:libretime/libretime +apt-get -q update +apt-get install -y gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + libgirepository1.0-dev \ + liquidsoap \ + liquidsoap-plugin-faad \ + liquidsoap-plugin-lame \ + liquidsoap-plugin-mad \ + liquidsoap-plugin-vorbis \ + python3-gst-1.0 \ + silan \ + gcc \ + gir1.2-gtk-3.0 \ + python3-setuptools \ + python3-gi \ + python3-gi-cairo \ + python-cairo \ + pkg-config \ + libcairo2-dev \ + php \ + php-curl \ + php-gd \ + php-pgsql diff --git a/.github/scripts/python-pkg-install.sh b/.github/scripts/python-pkg-install.sh new file mode 100644 index 000000000..861bf47cf --- /dev/null +++ b/.github/scripts/python-pkg-install.sh @@ -0,0 +1,6 @@ +#/bin/bash + +pip3 install -e python_apps/airtime_analyzer/. +pip3 install -e python_apps/airtime-celery/. +pip3 install -e python_apps/api_clients/. +pip3 install -e python_apps/pypo/. \ No newline at end of file diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh new file mode 100644 index 000000000..c72eefdb6 --- /dev/null +++ b/.github/scripts/python-pkg-test.sh @@ -0,0 +1,12 @@ +#/bin/bash + +# Starting at repo root + +cd python_apps/airtime_analyzer +nosetests . + +cd ../api_clients +nosetests . + +# Reset to repo root +cd ../.. \ No newline at end of file diff --git a/.github/workflows/test-bionic.yml b/.github/workflows/test-bionic.yml new file mode 100644 index 000000000..5ed93c17f --- /dev/null +++ b/.github/workflows/test-bionic.yml @@ -0,0 +1,30 @@ +name: test-bionic +on: + push: + paths-ignore: + - 'docs/**' + pull_request: + types: [opened, ready_for_review, review_requested] + paths-ignore: + - 'docs/**' + workflow_dispatch: + +jobs: + test-xenial: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.6' + - uses: harmon758/postgresql-action@v1 + with: + postgresql version: '11' + postgresql db: 'libretime' + postgresql user: 'libretime' + postgresql password: 'libretime' + - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime + - run: sudo bash ./.github/scripts/install.sh + - run: sudo composer install + - run: sudo bash ./.github/scripts/python-pkg-install.sh + - run: sudo bash ./.github/scripts/python-pkg-test.sh diff --git a/.github/workflows/test-xenial.md b/.github/workflows/test-xenial.yml similarity index 58% rename from .github/workflows/test-xenial.md rename to .github/workflows/test-xenial.yml index 9b8dd0513..108d3a170 100644 --- a/.github/workflows/test-xenial.md +++ b/.github/workflows/test-xenial.yml @@ -7,7 +7,6 @@ on: types: [opened, ready_for_review, review_requested] paths-ignore: - 'docs/**' - workflow_dispatch: jobs: @@ -25,12 +24,7 @@ jobs: postgresql user: 'libretime' postgresql password: 'libretime' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - - run: psql -c 'ALTER USER libretime CREATEDB;' -U postgres - - run: ./dev_tools/ci/install.sh - - run: composer install - - run: pip3 install -e python_apps/airtime_analyzer/. - - run: pip3 install -e python_apps/airtime-celery/. - - run: pip3 install -e python_apps/api_clients/. - - run: pip3 install -e python_apps/pypo/. - - run: nosetests python_apps/airtime_analyzer/. - - run: nosetests python_apps/api_clients/. + - run: sudo bash ./.github/scripts/install.sh + - run: sudo composer install + - run: sudo bash ./.github/scripts/python-pkg-install.sh + - run: sudo bash ./.github/scripts/python-pkg-test.sh