From 977f5e96690cfc997c8a082c1b84fc6a99e2a24f Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 30 Nov 2020 21:00:10 -0500 Subject: [PATCH 01/60] Establishing Xenial test workflow --- .github/workflows/test-xenial.md | 29 ++++++++++++++++++++++++ dev_tools/ci/install.sh | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/test-xenial.md create mode 100644 dev_tools/ci/install.sh diff --git a/.github/workflows/test-xenial.md b/.github/workflows/test-xenial.md new file mode 100644 index 000000000..074b04494 --- /dev/null +++ b/.github/workflows/test-xenial.md @@ -0,0 +1,29 @@ +name: test-xenial +on: + push: + paths-ignore: + - 'docs/**' +jobs: + test-xenial: + runs-on: ubuntu-16.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.5' + - 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: psql -c 'ALTER USER libretime CREATEDB;' -U postgres + - run: sudo bash dev_tools/ci/install.sh + - run: sudo composer install + - run: sudo pip3 install -e python_apps/airtime_analyzer/. + - run: sudo pip3 install -e python_apps/airtime-celery/. + - run: sudo pip3 install -e python_apps/api_clients/. + - run: sudo pip3 install -e python_apps/pypo/. + - run: nosetests python_apps/airtime_analyzer/. + - run: nosetests python_apps/api_clients/. diff --git a/dev_tools/ci/install.sh b/dev_tools/ci/install.sh new file mode 100644 index 000000000..3450290cb --- /dev/null +++ b/dev_tools/ci/install.sh @@ -0,0 +1,39 @@ +#/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 \ + iquidsoap-plugin-mad \ + liquidsoap-plugin-vorbis \ + python3-gst-1.0 \ + silan \ + gcc \ + gir1.2-gtk-3.0 \ + python3-gi \ + python3-gi-cairo \ + python-cairo \ + pkg-config \ + libcairo2-dev \ + php \ + php-curl \ + php-gd \ + php-pgsql + +cd ../../python_apps/airtime_analyzer +pip3 install -e . + +cd ../../python_apps/airtime-celery +pip3 install -e . + +cd ../../python_apps/api_clients +pip3 install -e . + +cd ../../python_apps/pypo +pip3 install -e . \ No newline at end of file From fc8b3df0eeb4606413ced6c3fe9637902f995531 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 30 Nov 2020 21:03:07 -0500 Subject: [PATCH 02/60] Removing sudo --- .github/workflows/test-xenial.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-xenial.md b/.github/workflows/test-xenial.md index 074b04494..0388dd1c2 100644 --- a/.github/workflows/test-xenial.md +++ b/.github/workflows/test-xenial.md @@ -19,11 +19,11 @@ jobs: postgresql password: 'libretime' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - run: psql -c 'ALTER USER libretime CREATEDB;' -U postgres - - run: sudo bash dev_tools/ci/install.sh - - run: sudo composer install - - run: sudo pip3 install -e python_apps/airtime_analyzer/. - - run: sudo pip3 install -e python_apps/airtime-celery/. - - run: sudo pip3 install -e python_apps/api_clients/. - - run: sudo pip3 install -e python_apps/pypo/. + - 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/. From e58bbd31e88bcd1a820b99877648cb863399254d Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 30 Nov 2020 21:15:42 -0500 Subject: [PATCH 03/60] Adding triggers for PRs --- .github/workflows/test-xenial.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-xenial.md b/.github/workflows/test-xenial.md index 0388dd1c2..9a3ef148e 100644 --- a/.github/workflows/test-xenial.md +++ b/.github/workflows/test-xenial.md @@ -3,6 +3,10 @@ on: push: paths-ignore: - 'docs/**' + pull_request: + types: [opened, ready_for_review, review_requested] + paths-ignore: + - 'docs/**' jobs: test-xenial: runs-on: ubuntu-16.04 From 1d8b2754af86b05bd05a42fdfc0ce8e39aa3960e Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 30 Nov 2020 21:17:43 -0500 Subject: [PATCH 04/60] Removing files for Travis CI --- .travis.yml | 97 ----------------------------------------------- travis/install.sh | 24 ------------ travis/release.sh | 7 ---- travis/test.sh | 18 --------- 4 files changed, 146 deletions(-) delete mode 100644 .travis.yml delete mode 100755 travis/install.sh delete mode 100755 travis/release.sh delete mode 100755 travis/test.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6bf9c2f50..000000000 --- a/.travis.yml +++ /dev/null @@ -1,97 +0,0 @@ -dist: xenial - -services: - - postgresql - -env: - global: - - ENVIRONMENT=testing - - LIBRETIME_LOG_DIR=/tmp/log/libretime - -before_install: - - sudo add-apt-repository -y ppa:libretime/libretime - - sudo apt-get -q update - -addons: - apt: - packages: - - 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-gi - - python3-gi-cairo - - python-cairo - - pkg-config - - libcairo2-dev - -jobs: - include: -# - language: php -# php: 7.3 -# stage: test -# - language: php -# php: 7.2 -# stage: test - - language: php - php: 7.0 - stage: test - - language: php - php: 5.6 - stage: test -# - language: python -# python: 3.8 -# stage: test -# - language: python -# python: 3.6 -# stage: test - - language: python - python: 3.5 - stage: test - - stage: deploy - addons: - apt: - packages: - dos2unix - script: - ./travis/release.sh - deploy: - - provider: releases - token: $GITHUB_TOKEN - file: build/libretime-*.tar.gz - edge: true - on: - tags: true - allow_failures: - # https://github.com/LibreTime/libretime/issues/779 -# - language: php -# php: 7.3 -# - language: php -# php: 7.2 - # Ubuntu Bionic cloud image uses Python 3.6.9 -# - language: python -# python: 3.8 - # https://github.com/LibreTime/libretime/issues/1041 -# - language: python -# python: 3.5 - - language: php - php: 5.6 - -install: ./travis/install.sh -before_script: -- psql -c 'CREATE DATABASE libretime;' -U postgres -- psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" -U postgres -- psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' -U postgres -- psql -c 'ALTER USER libretime CREATEDB;' -U postgres -- mkdir -p /tmp/log/libretime -script: ./travis/test.sh diff --git a/travis/install.sh b/travis/install.sh deleted file mode 100755 index edcaaffb3..000000000 --- a/travis/install.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -xe - -if [[ -n "$TRAVIS_PHP_VERSION" ]]; then - composer install -fi -if [[ -n "$TRAVIS_PYTHON_VERSION" ]]; then - pushd python_apps/airtime_analyzer - pip3 install -e . - popd - - pushd python_apps/airtime-celery - pip3 install -e . - popd - - pushd python_apps/api_clients - pip3 install -e . - popd - - pushd python_apps/pypo - pip3 install -e . - popd -fi diff --git a/travis/release.sh b/travis/release.sh deleted file mode 100755 index 76536f574..000000000 --- a/travis/release.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -xe - -pushd dev_tools/release -bash -e release.sh ${TRAVIS_TAG} -popd diff --git a/travis/test.sh b/travis/test.sh deleted file mode 100755 index ab51c72e8..000000000 --- a/travis/test.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -xe - -if [[ -n "$TRAVIS_PHP_VERSION" ]]; then - pushd airtime_mvc/tests - ../../vendor/bin/phpunit - popd -fi -if [[ -n "$TRAVIS_PYTHON_VERSION" ]]; then - pushd python_apps/airtime_analyzer - nosetests - popd - - pushd python_apps/api_clients - nosetests - popd -fi From 70b8b1bfe1e5ab29a3a5a0c7277804fd6892997e Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 30 Nov 2020 21:34:16 -0500 Subject: [PATCH 05/60] Add manual run trigger --- .github/workflows/test-xenial.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-xenial.md b/.github/workflows/test-xenial.md index 9a3ef148e..9b8dd0513 100644 --- a/.github/workflows/test-xenial.md +++ b/.github/workflows/test-xenial.md @@ -7,6 +7,9 @@ on: types: [opened, ready_for_review, review_requested] paths-ignore: - 'docs/**' + + workflow_dispatch: + jobs: test-xenial: runs-on: ubuntu-16.04 From 34c511208c75ab886378b19d581d42de4920aa0b Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 30 Nov 2020 22:55:02 -0500 Subject: [PATCH 06/60] 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 From 77ae02cf971827e4126139096e528b4762f286f9 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 30 Nov 2020 22:55:47 -0500 Subject: [PATCH 07/60] Remove extra install script --- dev_tools/ci/install.sh | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 dev_tools/ci/install.sh diff --git a/dev_tools/ci/install.sh b/dev_tools/ci/install.sh deleted file mode 100644 index 3450290cb..000000000 --- a/dev_tools/ci/install.sh +++ /dev/null @@ -1,39 +0,0 @@ -#/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 \ - iquidsoap-plugin-mad \ - liquidsoap-plugin-vorbis \ - python3-gst-1.0 \ - silan \ - gcc \ - gir1.2-gtk-3.0 \ - python3-gi \ - python3-gi-cairo \ - python-cairo \ - pkg-config \ - libcairo2-dev \ - php \ - php-curl \ - php-gd \ - php-pgsql - -cd ../../python_apps/airtime_analyzer -pip3 install -e . - -cd ../../python_apps/airtime-celery -pip3 install -e . - -cd ../../python_apps/api_clients -pip3 install -e . - -cd ../../python_apps/pypo -pip3 install -e . \ No newline at end of file From dbbc666a8da5e549764755071bf1cafccaa42660 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Tue, 1 Dec 2020 14:13:45 -0500 Subject: [PATCH 08/60] Automating packaging take 1 #v.0.1 --- .github/scripts/package-release.sh | 48 +++++++++++++++++++++++++++ .github/workflows/package-release.yml | 41 +++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/scripts/package-release.sh create mode 100644 .github/workflows/package-release.yml diff --git a/.github/scripts/package-release.sh b/.github/scripts/package-release.sh new file mode 100644 index 000000000..1b1798ed1 --- /dev/null +++ b/.github/scripts/package-release.sh @@ -0,0 +1,48 @@ +#/bin/bash + +#release.sh 1.8.2 +#creates a libretime folder with a "1.8.2" suffix +#creates tarballs with a "1.8.2" suffix + +#release.sh 1.8.2 RC +#creates a libretime folder with a "1.8.2-RC" suffix +#creates tarballs with a "1.8.2-RC" suffix + +#release.sh 1.8.2-RC +#creates a libretime folder with a "1.8.2-RC" suffix +#creates tarballs with a "1.8.2-RC" suffix + +if [ $# == 0 ]; then + echo "Zero arguments" + exit 1 +elif [ $# == 1 ]; then + suffix=$1 + version=$1 +else + suffix=$1-$2 + version=$1 +fi + +# Adding dos2unix package +apt update -y -q +apt install dos2unix -y + +echo "Creating tarball for LibreTime ${suffix}." + +target_file=libretime-${suffix}.tar.gz + +echo -n "Running composer install..." +composer install --quiet --no-dev --ignore-platform-reqs +echo " Done" + +find libretime-${suffix} -type f -exec dos2unix {} \; +echo -n "Creating tarball..." +tar -czf $target_file \ + --owner=root --group=root \ + --exclude-vcs \ + --exclude .zfproject.xml \ + --exclude .gitignore \ + --exclude .gitattributes \ + --exclude dev_tools \ + libretime-${suffix} +echo " Done" diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml new file mode 100644 index 000000000..73762e151 --- /dev/null +++ b/.github/workflows/package-release.yml @@ -0,0 +1,41 @@ +name: Create Release .tar.gz + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-18.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Changes + - 1 + - 2 + draft: false + prerelease: false + - name: Build project # This would actually build your project + run: sudo bash ./.github/scripts/package-release.sh ${{ github.ref }} + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./libretime-${{ github.ref }}.tar.gz + asset_name: libretime-${{ github.ref }}.tar.gz + asset_content_type: application/tgz \ No newline at end of file From cd6e105c6e1ec50a7659a3340f640efef5b16504 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Tue, 1 Dec 2020 16:24:30 -0500 Subject: [PATCH 09/60] Automates import of release notes in body Requires RELEASENOTES file in repo root --- .github/workflows/package-release.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 73762e151..780ad0d4e 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -2,9 +2,10 @@ name: Create Release .tar.gz on: push: + branches: [ master ] # Sequence of patterns matched against refs/tags tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + - '\d+.\d+.\d+(~\s+\.\d+)*' # Originally '*', changes by @paddatrapper jobs: build: @@ -13,6 +14,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + - name: Read file contents + id: release_notes_file + uses: andstor/file-reader-action@v1 + with: + path: "RELEASENOTES" + - run: echo RELEASENOTES - name: Create Release id: create_release uses: actions/create-release@v1 @@ -21,10 +28,7 @@ jobs: with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} - body: | - Changes - - 1 - - 2 + body: ${ steps.release_notes_file.outputs.contents } draft: false prerelease: false - name: Build project # This would actually build your project From 35541522f7ea6c9abbd283920cef240e0f16e574 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 7 Dec 2020 15:25:41 -0500 Subject: [PATCH 10/60] Fixing database issues in testing --- .github/RELEASE.md | 168 ++++++++++++++++++++++++++ .github/scripts/install.sh | 11 +- .github/scripts/package-release.sh | 2 +- .github/workflows/package-release.yml | 6 +- .github/workflows/test-bionic.yml | 6 - .github/workflows/test-xenial.yml | 6 - 6 files changed, 182 insertions(+), 17 deletions(-) create mode 100644 .github/RELEASE.md diff --git a/.github/RELEASE.md b/.github/RELEASE.md new file mode 100644 index 000000000..d65c367bb --- /dev/null +++ b/.github/RELEASE.md @@ -0,0 +1,168 @@ +The complete LibreTime documentation is available at libretime.org. + +The full tarball for the 3.0.0-alpha.8 release of LibreTime is available here. + +Since this is an alpha release there will be bugs in the code. + +Please report new issues and/or feature requests in the issue tracker. Join our discourse or chat us up on Slack if you need help and for general discussion. +Table of Contents + + Features + Bugfixes + Deprecated Features + Contributors + Installation + Updating + Known Issues + Installer Issues + Media-Monitor config needs manual removing + Outdated silan reports unreliable cue in/out information + Liquidsoap support + No watched folder support + No Line In recording support + Playout wont work if locale is missing + Lack of i18n toolchain is disturbing + +Features + + The LibreTime project now has a proper logo! + New "Show Listener Stats" in "Analytics" contains listeners statistics on specific shows. + Display time of last podcast import in downloaded podcasts view. + Allow sorting by last play date in smartblocks, makes creating playlists that play the least played track possible. + Preliminary support for Debian Buster (Remember to patch the liquidsoap scripts if you use Buster). + +Bugfixes + + Widgets now use user specified timezones as they should. + Podcast view now display proper number of downloaded podcasts rather than just the first 25 podcasts. + Fix using non-ascii characters in podcast publishing service. + Fix canceling current show for "linked" shows. + Fix empty schedule page when previous track is empty. + Fix focus jumping to search in advanced search. + +Deprecated Features + + We are phasing out support for Debian 8 (Jessie). See the announcement in the 3.0.0-alpha.7 release notes for more details. + Liquidsoap 1.1.1 support. 3.0.0-alpha.8 is most likely the last version to support liquidsoap 1.1.1 out of the box. The number of distros that install a current version of liquidsoap are gaining the majority and once Ubuntu releases a version of their distro that has liquidsoap 1.3.x we will switch to native liquidsoap 1.3.x support. Users still on liquidsoap 1.1.1 will need to apply a patch to their liquidsoap scripts (or update liquidsoap). + +Contributors + +The LibreTime project wants to thank the following contributors for adding PRs to this release: + + @ciaby + @hairmare + @learning-more + @mirzazulfan + @paddatrapper + @Robbt + +Installation + +The main installation docs may be found at http://libretime.org/install/. They describe a "developer" install using the bundled install script. + +We are preparing packages for supported distros and you can take those for a spin if you would like to. Usually the packages get built pretty soon after a release is published. If the current version is not available from the below sources you should wait for a while until they get uploaded. + + Ubuntu packages + Debian packages + CentOS packages + +Please reference these links for further information on how to install from packages. The install docs will get updated to show how to install packages once we have validated that the packages work properly and when the packages are available from a repository allowing you to automate updating to a new version. +Updating + +See the docs for complete information on updating. Please ensure that you have proper backups and a rollback scenario in place before updating. +If the update does not go smoothly, it may cause significant downtime, so you should always have a fallback system available during the update to ensure broadcast continuity. + +If you installed from GitHub you can git pull in your local working copy and re-run the ./install script with the same --web-root and --web-user arguments you used during the initial install. Tarball users can leave out the git pull part and just call the new version of the install script. +Updating from 3.0.0-alpha, 3.0.0-alpha.1 and, 3.0.0-alpha.2 + +The configuration file structure has changed. Please move the contents of the /etc/airtime/cloud_storage.conf and /etc/airtime/rabbitmq-analyzer.ini files into the main /etc/airtime/airtime.conf. In all known cases you need to add the following section to the file. + +[current_backend] +storage_backend=file + +You can then remove the files and the symlink. + +rm /etc/airtime/cloud_storage.conf \ + /etc/airtime/rabbitmq-analyzer.ini \ + /etc/airtime/production + +While you're at you may also want to remove the amazon_s3 section if it was in any of the files. + +Analyzer grabs all the needed info from the main airtime.conf file starting with 3.0.0-alpha.8. +Known Issues + +The following issues may need a workaround for the time being. Please search the issues before reporting problems not listed below. +Installer Issues + +The installer is generally a bit unstable, we hope to be able to offer some reasonable packages at some point. Some of the GUI driven parts before the first login are also in a somewhat questionable state, ymmv. + +For now the installer distro selection is pretty good at auto-detecting your os and usually does an ok job depending on your distro. You should usually not need to pass a --distribution and --release parameter, those are still supported for the time being but their use is not recommended. + +The UI works best if you don't use it in an opinionated fashion and change just the bare minimal. + +If you want a secure environment you should work through the preparing the server docs (up until the dragons) and be prepared to fix some of the issues the installer gets wrong manually by hacking the config file after the fact. + +If you want to skip the installer GUI completely you can configure LibreTime using airtime_mvc/build/airtime.example.conf as an template. Due to some python/PHP differences you must remove all comments from the example to use it 😞. You'll also have to create some folder structures manually and check if the music dir got properly created directly in the database. Referencing a second install -fiap install on a non productive system for reference can help with this type of bootstrap. +Media-Monitor config needs manual removing + +If you are using the install script you should most likely remove the [media-monitor] config section from your /etc/airtime/airtime.conf file to ensure you do not run into the problems described in +#450. We recommend you do this before running the update since there are no known LibreTime releases that depend on the config value. +Outdated silan reports unreliable cue in/out information + +Out of the box the installer installs a broken, outdated version of silan (0.3.2) on some Debian based Platforms (ie. Ubuntu). This affects Ubuntu 16.04, Debian Jessie and Debian Stretch. CentOS does not have upstream packages and you may either install from source or use the 0.3.3 packages from RaBe APEL. + +Check your version of silan by running silan --version. This should report 0.3.3 or higher. If not please see the Silan Installation wiki page for more details & workarounds. + +To date silan 0.3.3 or higher is in Debian testing & Ubuntu Bionic. You can check the upstream progress the Debian PTS and Ubuntu launchpad. This section will get removed once the package is in stable. + +tldr: Silan Installation +Liquidsoap Support + +Libretime currently only supports liquidsoap < 1.3.0 out of the box. If you install a current version of liquidsoap using OPAM or through the Rabe Liquidsoap Distribution for CentOS (RaBe LSD) you will most likely have liquidsoap 1.3.2 or 1.3.3 installed. + +#352 reports that liquidsoap < 1.3.0 can exhibit issues on Debian Stretch installs. One fix for the issue is to install liquidsoap 1.3.0 and to use the following patching steps. + +You can check your liquidsoap version by running liquidsoap --version. + +If you already have liquidsoap >= 1.3.0 you have a couple of options. +Liquidsoap 1.3.0 Patchset (#192) + +You can patch your installation of LibreTime to support liquidsoap 1.3.0. + +An up to date patch is available through GitHub and can be applied to an unpacked tarball as follows. + +cd libretime-3.0.0-alpha.8/ +curl -L https://github.com/LibreTime/libretime/compare/master...radiorabe:feature/liquidsoap-1.3-for-3.0.0-alpha.7.patch | patch -p1 + +Git users can pull from the branch at master...radiorabe:feature/liquidsoap-1.3.0-for-3.0.0-alpha.7 directly. +Install old liquidsoap from opam (#192) + +You can downgrade an OPAM install of liquidsoap by running the following command. + +opam install "liquidsoap<1.3.0" + +No watched folder support + +Currently LibreTime does not support watching folders. Uploading files through the web interface works fine and can be automated via a REST API. Re-implementing watched folder support is on the roadmap. Please consider helping out with the code to help speed things along if you want to use the feature. +No line in support + +This feature went missing from LibreTime due to the fact that we based our code off of the saas-dev branch of legacy upstream and support for recording hasn't been ported to the new airtime analyzer ingest system. #42 currently tracks the progress being made on line in recording. +Playout wont work if locale is missing + +Some minimal OS installs do not have a default locale configured. This only seems to affect some VPS installs as they often do not have a locale setup in the default images provided. + +You can set up the locale using a combination of the following commands. You might also want to consult the documentation of your VPS provider as it may contain an official way to set up locales when provisioning a VPS. + +# Set locale using systemds localectl +localectl set-locale LANG="en_US.utf8" + +These instructions do not seem to work on all Debian based distros so you might need to use update-locale as follows. + +#Purge all locales but en_US.UTF-8 +sudo locale-gen --purge en_US.UTF-8 +#Populate LANGUAGE= +sudo update-locale LANGUAGE="en_US.UTF-8" + +Lack of i18n toolchain is disturbing + +Some translations might miss the tarball. They didn't get lost, but the build chain needs fixing. Work is in #301 and additional work is needed as it has become clear that we probably want to support bidirectional translation syncing with zanata. \ No newline at end of file diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index 751987497..35d4c95d0 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -1,5 +1,6 @@ #/bin/bash +# Adding repos and packages add-apt-repository -y ppa:libretime/libretime apt-get -q update apt-get install -y gstreamer1.0-plugins-base \ @@ -25,4 +26,12 @@ apt-get install -y gstreamer1.0-plugins-base \ php \ php-curl \ php-gd \ - php-pgsql + php-pgsql \ + postgresql \ + postgresql-client + +# Creating database for testing +psql -c 'CREATE DATABASE libretime;' -U postgres +psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" -U postgres +psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' -U postgres +psql -c 'ALTER USER libretime CREATEDB;' -U postgres \ No newline at end of file diff --git a/.github/scripts/package-release.sh b/.github/scripts/package-release.sh index 1b1798ed1..c170dfc68 100644 --- a/.github/scripts/package-release.sh +++ b/.github/scripts/package-release.sh @@ -25,7 +25,7 @@ fi # Adding dos2unix package apt update -y -q -apt install dos2unix -y +apt install dos2unix php composer -y echo "Creating tarball for LibreTime ${suffix}." diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 780ad0d4e..86976d158 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -6,6 +6,7 @@ on: # Sequence of patterns matched against refs/tags tags: - '\d+.\d+.\d+(~\s+\.\d+)*' # Originally '*', changes by @paddatrapper + workflow_dispatch: jobs: build: @@ -18,8 +19,7 @@ jobs: id: release_notes_file uses: andstor/file-reader-action@v1 with: - path: "RELEASENOTES" - - run: echo RELEASENOTES + path: ./.github/RELEASE.md - name: Create Release id: create_release uses: actions/create-release@v1 @@ -42,4 +42,4 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./libretime-${{ github.ref }}.tar.gz asset_name: libretime-${{ github.ref }}.tar.gz - asset_content_type: application/tgz \ No newline at end of file + asset_content_type: application/tgz diff --git a/.github/workflows/test-bionic.yml b/.github/workflows/test-bionic.yml index 5ed93c17f..e3d8a4f58 100644 --- a/.github/workflows/test-bionic.yml +++ b/.github/workflows/test-bionic.yml @@ -17,12 +17,6 @@ jobs: - 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 diff --git a/.github/workflows/test-xenial.yml b/.github/workflows/test-xenial.yml index 108d3a170..d7e564e21 100644 --- a/.github/workflows/test-xenial.yml +++ b/.github/workflows/test-xenial.yml @@ -17,12 +17,6 @@ jobs: - uses: actions/setup-python@v2 with: python-version: '3.5' - - 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 From 25a40d213112305cc6c652f9e05caba7f554088c Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 7 Dec 2020 15:35:31 -0500 Subject: [PATCH 11/60] Attempting database install fix --- .github/scripts/install.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index 35d4c95d0..b944b7eee 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -31,7 +31,22 @@ apt-get install -y gstreamer1.0-plugins-base \ postgresql-client # Creating database for testing -psql -c 'CREATE DATABASE libretime;' -U postgres -psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" -U postgres -psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' -U postgres -psql -c 'ALTER USER libretime CREATEDB;' -U postgres \ No newline at end of file + setupAirtimePostgresUser() { + # here-doc to execute this block as postgres user + su postgres <<'EOF' + set +e + count=$(psql -d postgres -tAc "SELECT count(*) FROM pg_roles WHERE rolname='airtime';") + if [[ $count -eq 0 ]]; then + psql -d postgres -tAc "CREATE USER airtime WITH ENCRYPTED PASSWORD 'airtime'; ALTER USER airtime CREATEDB; CREATE DATABASE libretime; GRANT CONNECT ON DATABASE libretime TO libretime;" + [[ $? -eq 0 ]] && + echo "Created airtime user in PostgreSQL" || + echo "$0:${FUNCNAME}(): ERROR: Can't create airtime user in PostgreSQL!" + else + echo "airtime user already exists in PostgreSQL" + fi + set -e +# don't indent this! +EOF + } + +setupAirtimePostgresUser \ No newline at end of file From 1008182c64ce067d28f240581bf7d8e6a9dfeaa2 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 9 Dec 2020 16:43:38 -0500 Subject: [PATCH 12/60] Working on fixing packaging process --- .github/RELEASE.md | 41 +++++++++++-------- .../{package-release.sh => release.sh} | 17 ++++++++ .github/workflows/package-release.yml | 2 +- 3 files changed, 43 insertions(+), 17 deletions(-) rename .github/scripts/{package-release.sh => release.sh} (69%) diff --git a/.github/RELEASE.md b/.github/RELEASE.md index d65c367bb..a1b8959a2 100644 --- a/.github/RELEASE.md +++ b/.github/RELEASE.md @@ -5,7 +5,8 @@ The full tarball for the 3.0.0-alpha.8 release of LibreTime is available here. Since this is an alpha release there will be bugs in the code. Please report new issues and/or feature requests in the issue tracker. Join our discourse or chat us up on Slack if you need help and for general discussion. -Table of Contents + +## Table of Contents Features Bugfixes @@ -23,7 +24,7 @@ Table of Contents Playout wont work if locale is missing Lack of i18n toolchain is disturbing -Features +## Features The LibreTime project now has a proper logo! New "Show Listener Stats" in "Analytics" contains listeners statistics on specific shows. @@ -31,7 +32,7 @@ Features Allow sorting by last play date in smartblocks, makes creating playlists that play the least played track possible. Preliminary support for Debian Buster (Remember to patch the liquidsoap scripts if you use Buster). -Bugfixes +## Bugfixes Widgets now use user specified timezones as they should. Podcast view now display proper number of downloaded podcasts rather than just the first 25 podcasts. @@ -40,12 +41,12 @@ Bugfixes Fix empty schedule page when previous track is empty. Fix focus jumping to search in advanced search. -Deprecated Features +## Deprecated Features We are phasing out support for Debian 8 (Jessie). See the announcement in the 3.0.0-alpha.7 release notes for more details. Liquidsoap 1.1.1 support. 3.0.0-alpha.8 is most likely the last version to support liquidsoap 1.1.1 out of the box. The number of distros that install a current version of liquidsoap are gaining the majority and once Ubuntu releases a version of their distro that has liquidsoap 1.3.x we will switch to native liquidsoap 1.3.x support. Users still on liquidsoap 1.1.1 will need to apply a patch to their liquidsoap scripts (or update liquidsoap). -Contributors +## Contributors The LibreTime project wants to thank the following contributors for adding PRs to this release: @@ -56,7 +57,7 @@ The LibreTime project wants to thank the following contributors for adding PRs t @paddatrapper @Robbt -Installation +## Installation The main installation docs may be found at http://libretime.org/install/. They describe a "developer" install using the bundled install script. @@ -77,8 +78,10 @@ Updating from 3.0.0-alpha, 3.0.0-alpha.1 and, 3.0.0-alpha.2 The configuration file structure has changed. Please move the contents of the /etc/airtime/cloud_storage.conf and /etc/airtime/rabbitmq-analyzer.ini files into the main /etc/airtime/airtime.conf. In all known cases you need to add the following section to the file. +``` [current_backend] storage_backend=file +``` You can then remove the files and the symlink. @@ -89,10 +92,12 @@ rm /etc/airtime/cloud_storage.conf \ While you're at you may also want to remove the amazon_s3 section if it was in any of the files. Analyzer grabs all the needed info from the main airtime.conf file starting with 3.0.0-alpha.8. -Known Issues + +## Known Issues The following issues may need a workaround for the time being. Please search the issues before reporting problems not listed below. -Installer Issues + +### Installer Issues The installer is generally a bit unstable, we hope to be able to offer some reasonable packages at some point. Some of the GUI driven parts before the first login are also in a somewhat questionable state, ymmv. @@ -102,8 +107,9 @@ The UI works best if you don't use it in an opinionated fashion and change just If you want a secure environment you should work through the preparing the server docs (up until the dragons) and be prepared to fix some of the issues the installer gets wrong manually by hacking the config file after the fact. -If you want to skip the installer GUI completely you can configure LibreTime using airtime_mvc/build/airtime.example.conf as an template. Due to some python/PHP differences you must remove all comments from the example to use it 😞. You'll also have to create some folder structures manually and check if the music dir got properly created directly in the database. Referencing a second install -fiap install on a non productive system for reference can help with this type of bootstrap. -Media-Monitor config needs manual removing +If you want to skip the installer GUI completely you can configure LibreTime using airtime_mvc/build/airtime.example.conf as an template. Due to some python/PHP differences you must remove all comments from the example to use it 😞. You'll also have to create some folder structures manually and check if the music dir got properly created directly in the database. Referencing a second `install -fiap` install on a non productive system for reference can help with this type of bootstrap. + +### Media-Monitor config needs manual removing If you are using the install script you should most likely remove the [media-monitor] config section from your /etc/airtime/airtime.conf file to ensure you do not run into the problems described in #450. We recommend you do this before running the update since there are no known LibreTime releases that depend on the config value. @@ -115,8 +121,9 @@ Check your version of silan by running silan --version. This should report 0.3.3 To date silan 0.3.3 or higher is in Debian testing & Ubuntu Bionic. You can check the upstream progress the Debian PTS and Ubuntu launchpad. This section will get removed once the package is in stable. -tldr: Silan Installation -Liquidsoap Support +> tldr: Silan Installation + +### Liquidsoap Support Libretime currently only supports liquidsoap < 1.3.0 out of the box. If you install a current version of liquidsoap using OPAM or through the Rabe Liquidsoap Distribution for CentOS (RaBe LSD) you will most likely have liquidsoap 1.3.2 or 1.3.3 installed. @@ -141,10 +148,11 @@ You can downgrade an OPAM install of liquidsoap by running the following command opam install "liquidsoap<1.3.0" -No watched folder support +###No watched folder support Currently LibreTime does not support watching folders. Uploading files through the web interface works fine and can be automated via a REST API. Re-implementing watched folder support is on the roadmap. Please consider helping out with the code to help speed things along if you want to use the feature. -No line in support + +### No line in support This feature went missing from LibreTime due to the fact that we based our code off of the saas-dev branch of legacy upstream and support for recording hasn't been ported to the new airtime analyzer ingest system. #42 currently tracks the progress being made on line in recording. Playout wont work if locale is missing @@ -153,7 +161,8 @@ Some minimal OS installs do not have a default locale configured. This only seem You can set up the locale using a combination of the following commands. You might also want to consult the documentation of your VPS provider as it may contain an official way to set up locales when provisioning a VPS. -# Set locale using systemds localectl +### Set locale using systemds localectl + localectl set-locale LANG="en_US.utf8" These instructions do not seem to work on all Debian based distros so you might need to use update-locale as follows. @@ -163,6 +172,6 @@ sudo locale-gen --purge en_US.UTF-8 #Populate LANGUAGE= sudo update-locale LANGUAGE="en_US.UTF-8" -Lack of i18n toolchain is disturbing +### Lack of i18n toolchain is disturbing Some translations might miss the tarball. They didn't get lost, but the build chain needs fixing. Work is in #301 and additional work is needed as it has become clear that we probably want to support bidirectional translation syncing with zanata. \ No newline at end of file diff --git a/.github/scripts/package-release.sh b/.github/scripts/release.sh similarity index 69% rename from .github/scripts/package-release.sh rename to .github/scripts/release.sh index c170dfc68..ed5ac2ba8 100644 --- a/.github/scripts/package-release.sh +++ b/.github/scripts/release.sh @@ -29,12 +29,29 @@ apt install dos2unix php composer -y echo "Creating tarball for LibreTime ${suffix}." +target=/tmp/libretime-${suffix} target_file=libretime-${suffix}.tar.gz +rm -rf $target +rm -f $target_file +mkdir $target + +echo -n "Creating VERSION file for ${suffix}..." +echo -n "${suffix}" > ${target}/VERSION +echo " Done" + echo -n "Running composer install..." composer install --quiet --no-dev --ignore-platform-reqs echo " Done" +# Adding back; may be useful later... +#echo "Minimizing LibreTime Javascript files..." +#cd $dir +#find $target/airtime_mvc/public/js/airtime/ -iname "*.js" -exec bash -c 'echo {}; jsmin/jsmin < {} > {}.min' \; +#find $target/airtime_mvc/public/js/airtime/ -iname "*.js" -exec mv {}.min {} \; +#echo "Done" + +cd /tmp/ find libretime-${suffix} -type f -exec dos2unix {} \; echo -n "Creating tarball..." tar -czf $target_file \ diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 86976d158..86e5e05d3 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -32,7 +32,7 @@ jobs: draft: false prerelease: false - name: Build project # This would actually build your project - run: sudo bash ./.github/scripts/package-release.sh ${{ github.ref }} + run: sudo bash ./.github/scripts/release.sh ${{ github.ref }} - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 From 6e57e10169346160d61d45f167474431f3ad175c Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 9 Dec 2020 16:58:41 -0500 Subject: [PATCH 13/60] New idea: work out of one directory --- .github/scripts/release.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh index ed5ac2ba8..af1df447c 100644 --- a/.github/scripts/release.sh +++ b/.github/scripts/release.sh @@ -23,21 +23,14 @@ else version=$1 fi +echo "Creating tarball for LibreTime ${suffix}." + # Adding dos2unix package apt update -y -q apt install dos2unix php composer -y -echo "Creating tarball for LibreTime ${suffix}." - -target=/tmp/libretime-${suffix} -target_file=libretime-${suffix}.tar.gz - -rm -rf $target -rm -f $target_file -mkdir $target - echo -n "Creating VERSION file for ${suffix}..." -echo -n "${suffix}" > ${target}/VERSION +echo -n "${suffix}" > ./VERSION echo " Done" echo -n "Running composer install..." @@ -51,15 +44,15 @@ echo " Done" #find $target/airtime_mvc/public/js/airtime/ -iname "*.js" -exec mv {}.min {} \; #echo "Done" -cd /tmp/ +cd .. find libretime-${suffix} -type f -exec dos2unix {} \; echo -n "Creating tarball..." -tar -czf $target_file \ +tar -czf libretime-${suffix}.tar.gz \ --owner=root --group=root \ --exclude-vcs \ --exclude .zfproject.xml \ --exclude .gitignore \ --exclude .gitattributes \ --exclude dev_tools \ - libretime-${suffix} + libretime echo " Done" From 97db37e9f2d69f737c4b3912ae1e9c72d9157a17 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 9 Dec 2020 17:03:49 -0500 Subject: [PATCH 14/60] Adding back exclusions, fixing asset_path --- .github/scripts/release.sh | 4 ++++ .github/workflows/package-release.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh index af1df447c..f54c586e3 100644 --- a/.github/scripts/release.sh +++ b/.github/scripts/release.sh @@ -53,6 +53,10 @@ tar -czf libretime-${suffix}.tar.gz \ --exclude .zfproject.xml \ --exclude .gitignore \ --exclude .gitattributes \ + --exclude .travis.yml \ + --exclude travis \ --exclude dev_tools \ + --exclude vendor/phing \ + --exclude vendor/simplepie/simplepie/tests \ libretime echo " Done" diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 86e5e05d3..7289dcc82 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -40,6 +40,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./libretime-${{ github.ref }}.tar.gz + asset_path: ../libretime-${{ github.ref }}.tar.gz asset_name: libretime-${{ github.ref }}.tar.gz asset_content_type: application/tgz From b444f7d3b16a64526a67548d241285b68b46d7ae Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 9 Dec 2020 18:07:48 -0500 Subject: [PATCH 15/60] Adding -x to nosetests and correcting DB setup scripts --- .github/scripts/install.sh | 24 +++++------------------- .github/scripts/python-pkg-test.sh | 4 ++-- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index b944b7eee..d8e095b90 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -31,22 +31,8 @@ apt-get install -y gstreamer1.0-plugins-base \ postgresql-client # Creating database for testing - setupAirtimePostgresUser() { - # here-doc to execute this block as postgres user - su postgres <<'EOF' - set +e - count=$(psql -d postgres -tAc "SELECT count(*) FROM pg_roles WHERE rolname='airtime';") - if [[ $count -eq 0 ]]; then - psql -d postgres -tAc "CREATE USER airtime WITH ENCRYPTED PASSWORD 'airtime'; ALTER USER airtime CREATEDB; CREATE DATABASE libretime; GRANT CONNECT ON DATABASE libretime TO libretime;" - [[ $? -eq 0 ]] && - echo "Created airtime user in PostgreSQL" || - echo "$0:${FUNCNAME}(): ERROR: Can't create airtime user in PostgreSQL!" - else - echo "airtime user already exists in PostgreSQL" - fi - set -e -# don't indent this! -EOF - } - -setupAirtimePostgresUser \ No newline at end of file +-u postgres psql -c 'CREATE DATABASE libretime;' +-u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" +-u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' +-u postgres psql -c 'ALTER USER libretime CREATEDB;' +mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh index c72eefdb6..5bb2c39d8 100644 --- a/.github/scripts/python-pkg-test.sh +++ b/.github/scripts/python-pkg-test.sh @@ -3,10 +3,10 @@ # Starting at repo root cd python_apps/airtime_analyzer -nosetests . +nosetests . -x cd ../api_clients -nosetests . +nosetests . -x # Reset to repo root cd ../.. \ No newline at end of file From 365b65f21f881aae4dcfa5f21cf9313dfd504dba Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 9 Dec 2020 18:21:47 -0500 Subject: [PATCH 16/60] Merging Bionic and Xenial tests --- .../{test-bionic.yml => test-all-Ubuntu.yml} | 14 ++++++++++- .github/workflows/test-xenial.yml | 24 ------------------- 2 files changed, 13 insertions(+), 25 deletions(-) rename .github/workflows/{test-bionic.yml => test-all-Ubuntu.yml} (59%) delete mode 100644 .github/workflows/test-xenial.yml diff --git a/.github/workflows/test-bionic.yml b/.github/workflows/test-all-Ubuntu.yml similarity index 59% rename from .github/workflows/test-bionic.yml rename to .github/workflows/test-all-Ubuntu.yml index e3d8a4f58..a69cb6623 100644 --- a/.github/workflows/test-bionic.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: jobs: - test-xenial: + test-bionic: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 @@ -22,3 +22,15 @@ jobs: - run: sudo composer install - run: sudo bash ./.github/scripts/python-pkg-install.sh - run: sudo bash ./.github/scripts/python-pkg-test.sh + test-xenial: + runs-on: ubuntu-16.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.5' + - 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.yml b/.github/workflows/test-xenial.yml deleted file mode 100644 index d7e564e21..000000000 --- a/.github/workflows/test-xenial.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: test-xenial -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-16.04 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.5' - - 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 From da8ab32073cdd38c5f6d6ec1e32a9d2267f7b678 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 9 Dec 2020 18:25:15 -0500 Subject: [PATCH 17/60] Typo --- .github/workflows/test-all-Ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index a69cb6623..6e54e9801 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -1,4 +1,4 @@ -name: test-bionic +name: test-all-Ubuntu on: push: paths-ignore: From 76a52a8ebd0607029234d0058718d5a067f40960 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 9 Dec 2020 18:28:46 -0500 Subject: [PATCH 18/60] Adding sudos to install.sh --- .github/scripts/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index d8e095b90..b8d0ac102 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -31,8 +31,8 @@ apt-get install -y gstreamer1.0-plugins-base \ postgresql-client # Creating database for testing --u postgres psql -c 'CREATE DATABASE libretime;' --u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" --u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' --u postgres psql -c 'ALTER USER libretime CREATEDB;' +sudo -u postgres psql -c 'CREATE DATABASE libretime;' +sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" +sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' +sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' mkdir -p /tmp/log/libretime \ No newline at end of file From 85e1f29ea4b939e2e35c619a03fa0a6eda4857d7 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 10 Dec 2020 12:29:40 -0500 Subject: [PATCH 19/60] Adding systemctl restart postgres --- .github/scripts/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index b8d0ac102..7d3f86efe 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -31,6 +31,7 @@ apt-get install -y gstreamer1.0-plugins-base \ postgresql-client # Creating database for testing +systemctl restart postgres sudo -u postgres psql -c 'CREATE DATABASE libretime;' sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' From 25904e164f10e803be59babed0e55d884f884bc4 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 11 Dec 2020 12:25:06 -0500 Subject: [PATCH 20/60] Removing Postgre, Xenial from testing --- .github/scripts/install.sh | 11 ++--------- .github/workflows/test-all-Ubuntu.yml | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index 7d3f86efe..0edd6ac57 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -26,14 +26,7 @@ apt-get install -y gstreamer1.0-plugins-base \ php \ php-curl \ php-gd \ - php-pgsql \ - postgresql \ - postgresql-client + php-pgsql -# Creating database for testing -systemctl restart postgres -sudo -u postgres psql -c 'CREATE DATABASE libretime;' -sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" -sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' -sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' +# Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 6e54e9801..66ed744fe 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -22,15 +22,15 @@ jobs: - run: sudo composer install - run: sudo bash ./.github/scripts/python-pkg-install.sh - run: sudo bash ./.github/scripts/python-pkg-test.sh - test-xenial: - runs-on: ubuntu-16.04 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.5' - - 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 + # test-xenial: + # runs-on: ubuntu-16.04 + # steps: + # - uses: actions/checkout@v2 + # - uses: actions/setup-python@v2 + # with: + # python-version: '3.5' + # - 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 From aabef630c14e8f8802936da4cc78b5725ebf4911 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 11 Dec 2020 22:27:43 -0500 Subject: [PATCH 21/60] Removing PHP Composer test --- .github/workflows/test-all-Ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 66ed744fe..9f16d08a1 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -19,7 +19,7 @@ jobs: python-version: '3.6' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - run: sudo bash ./.github/scripts/install.sh - - run: sudo composer install + # - run: sudo composer install - run: sudo bash ./.github/scripts/python-pkg-install.sh - run: sudo bash ./.github/scripts/python-pkg-test.sh # test-xenial: From 2adf947148df74272e6298fede4e9472315dccca Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 11 Dec 2020 22:29:54 -0500 Subject: [PATCH 22/60] Removing PHP dependencies in test install --- .github/scripts/install.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index 0edd6ac57..98d8917a8 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -22,11 +22,7 @@ apt-get install -y gstreamer1.0-plugins-base \ python3-gi-cairo \ python-cairo \ pkg-config \ - libcairo2-dev \ - php \ - php-curl \ - php-gd \ - php-pgsql + libcairo2-dev # Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file From 488a6114400b2a389d2ff094627bb3778fe76ebc Mon Sep 17 00:00:00 2001 From: Zachary Klosko <31484611+zklosko@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:39:50 -0500 Subject: [PATCH 23/60] Adding back PHP tests (I think) --- .github/workflows/test-all-Ubuntu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 9f16d08a1..1a5d88e5a 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -19,7 +19,8 @@ jobs: python-version: '3.6' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - run: sudo bash ./.github/scripts/install.sh - # - run: sudo composer install + - run: sudo composer install + - run: cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit - run: sudo bash ./.github/scripts/python-pkg-install.sh - run: sudo bash ./.github/scripts/python-pkg-test.sh # test-xenial: From ab2bb53ff2ec5b4236de976a685069f75059f5e7 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 14:37:06 -0500 Subject: [PATCH 24/60] Adding back PHP and Postgres actions --- .github/scripts/init-postgres.sh | 6 +++ .../scripts/{install.sh => install-bionic.sh} | 13 ++++++- .github/scripts/install-xenial.sh | 39 +++++++++++++++++++ .github/workflows/test-all-Ubuntu.yml | 5 ++- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 .github/scripts/init-postgres.sh rename .github/scripts/{install.sh => install-bionic.sh} (76%) create mode 100644 .github/scripts/install-xenial.sh diff --git a/.github/scripts/init-postgres.sh b/.github/scripts/init-postgres.sh new file mode 100644 index 000000000..03069d5ac --- /dev/null +++ b/.github/scripts/init-postgres.sh @@ -0,0 +1,6 @@ +#/bin/bash + +psql -c 'CREATE DATABASE libretime;' -U postgres +psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" -U postgres +psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' -U postgres +psql -c 'ALTER USER libretime CREATEDB;' -U postgres \ No newline at end of file diff --git a/.github/scripts/install.sh b/.github/scripts/install-bionic.sh similarity index 76% rename from .github/scripts/install.sh rename to .github/scripts/install-bionic.sh index 98d8917a8..3dc548843 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install-bionic.sh @@ -22,7 +22,18 @@ apt-get install -y gstreamer1.0-plugins-base \ python3-gi-cairo \ python-cairo \ pkg-config \ - libcairo2-dev + libcairo2-dev \ + postgresql \ + postgresql-client + +apt-get install -y php7.2 \ + php7.2-curl \ + php7.2-gd \ + php7.2-pgsql \ + php-apcu \ + php-bcmath \ + php-mbstring \ + php-pear # Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/.github/scripts/install-xenial.sh b/.github/scripts/install-xenial.sh new file mode 100644 index 000000000..60412b82c --- /dev/null +++ b/.github/scripts/install-xenial.sh @@ -0,0 +1,39 @@ +#/bin/bash + +# Adding repos and packages +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 \ + postgresql \ + postgresql-client + +apt-get install -y php7.0 \ + php7.0-curl \ + php7.0-gd \ + php7.0-pgsql \ + php-apcu \ + php-bcmath \ + php-mbstring \ + php-pear + +# Making directory; not sure why... +mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 1a5d88e5a..b837ae615 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -18,9 +18,10 @@ jobs: with: python-version: '3.6' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - - run: sudo bash ./.github/scripts/install.sh + - run: sudo bash ./.github/scripts/install-bionic.sh + - run: sudo bash ./.github/scripts/init-postgres.sh - run: sudo composer install - - run: cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit + - run: cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit && cd ../.. - run: sudo bash ./.github/scripts/python-pkg-install.sh - run: sudo bash ./.github/scripts/python-pkg-test.sh # test-xenial: From 09dc9f53f34adf0901f939a6949685e2576efe98 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 14:53:22 -0500 Subject: [PATCH 25/60] Trying @pashagolub's suggestion --- .github/scripts/init-postgres.sh | 6 ------ .github/workflows/test-all-Ubuntu.yml | 24 ++++++++++++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) delete mode 100644 .github/scripts/init-postgres.sh diff --git a/.github/scripts/init-postgres.sh b/.github/scripts/init-postgres.sh deleted file mode 100644 index 03069d5ac..000000000 --- a/.github/scripts/init-postgres.sh +++ /dev/null @@ -1,6 +0,0 @@ -#/bin/bash - -psql -c 'CREATE DATABASE libretime;' -U postgres -psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" -U postgres -psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' -U postgres -psql -c 'ALTER USER libretime CREATEDB;' -U postgres \ No newline at end of file diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index b837ae615..9d2084a22 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -17,13 +17,25 @@ jobs: - uses: actions/setup-python@v2 with: python-version: '3.6' + - name: Setup PostgreSQL + run: | + sudo systemctl start postgresql.service + pg_isready + sudo -u postgres psql -c 'CREATE DATABASE libretime;' + sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" + sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' + sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - - run: sudo bash ./.github/scripts/install-bionic.sh - - run: sudo bash ./.github/scripts/init-postgres.sh - - run: sudo composer install - - run: cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit && cd ../.. - - run: sudo bash ./.github/scripts/python-pkg-install.sh - - run: sudo bash ./.github/scripts/python-pkg-test.sh + - name: Install prerequisites + run: sudo bash ./.github/scripts/install-bionic.sh + - name: Run PHP tests + run: | + sudo composer install + cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit && cd ../.. + - name: Run Python tests + run: | + sudo bash ./.github/scripts/python-pkg-install.sh + sudo bash ./.github/scripts/python-pkg-test.sh # test-xenial: # runs-on: ubuntu-16.04 # steps: From 6b55206effc1f1d8ad7f2302f6161c5fb0ec3ac4 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 14:57:42 -0500 Subject: [PATCH 26/60] Merging installer strings --- .github/scripts/install-bionic.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/scripts/install-bionic.sh b/.github/scripts/install-bionic.sh index 3dc548843..11b9f37c0 100644 --- a/.github/scripts/install-bionic.sh +++ b/.github/scripts/install-bionic.sh @@ -23,17 +23,14 @@ apt-get install -y gstreamer1.0-plugins-base \ python-cairo \ pkg-config \ libcairo2-dev \ - postgresql \ - postgresql-client - -apt-get install -y php7.2 \ + php7.2 \ php7.2-curl \ php7.2-gd \ php7.2-pgsql \ - php-apcu \ - php-bcmath \ - php-mbstring \ - php-pear + php7.2-apcu \ + php7.2-bcmath \ + php7.2-mbstring \ + php7.2-pear # Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file From 3877aead8c94625509130259b99edc27f7b77ffc Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 15:04:14 -0500 Subject: [PATCH 27/60] Adding PHP setup Github Action --- .github/scripts/install-bionic.sh | 10 +--------- .github/workflows/test-all-Ubuntu.yml | 4 ++++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/scripts/install-bionic.sh b/.github/scripts/install-bionic.sh index 11b9f37c0..ef7416abe 100644 --- a/.github/scripts/install-bionic.sh +++ b/.github/scripts/install-bionic.sh @@ -22,15 +22,7 @@ apt-get install -y gstreamer1.0-plugins-base \ python3-gi-cairo \ python-cairo \ pkg-config \ - libcairo2-dev \ - php7.2 \ - php7.2-curl \ - php7.2-gd \ - php7.2-pgsql \ - php7.2-apcu \ - php7.2-bcmath \ - php7.2-mbstring \ - php7.2-pear + libcairo2-dev # Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 9d2084a22..e4d53eebe 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -25,6 +25,10 @@ jobs: sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' + - name: Setup PHP with specific version + uses: shivammathur/setup-php@v2 + with: + php-version: '7.0' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - name: Install prerequisites run: sudo bash ./.github/scripts/install-bionic.sh From 537ceed683c8fd6ee8acc13f45bcbf34c43acaed Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 15:08:14 -0500 Subject: [PATCH 28/60] Readding PHP dependencies on install --- .github/scripts/install-bionic.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/scripts/install-bionic.sh b/.github/scripts/install-bionic.sh index ef7416abe..e91c23751 100644 --- a/.github/scripts/install-bionic.sh +++ b/.github/scripts/install-bionic.sh @@ -22,7 +22,14 @@ apt-get install -y gstreamer1.0-plugins-base \ python3-gi-cairo \ python-cairo \ pkg-config \ - libcairo2-dev + libcairo2-dev \ + php7.2-curl \ + php7.2-gd \ + php7.2-pgsql \ + php7.2-apcu \ + php7.2-bcmath \ + php7.2-mbstring \ + php7.2-pear # Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file From 7bad165adeb174a87163ee792275f570d54cf558 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 15:12:23 -0500 Subject: [PATCH 29/60] Changing dependencies --- .github/scripts/install-bionic.sh | 14 ++++----- .github/workflows/test-all-Ubuntu.yml | 42 +++++++++++++++++++-------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/scripts/install-bionic.sh b/.github/scripts/install-bionic.sh index e91c23751..942c0a07e 100644 --- a/.github/scripts/install-bionic.sh +++ b/.github/scripts/install-bionic.sh @@ -23,13 +23,13 @@ apt-get install -y gstreamer1.0-plugins-base \ python-cairo \ pkg-config \ libcairo2-dev \ - php7.2-curl \ - php7.2-gd \ - php7.2-pgsql \ - php7.2-apcu \ - php7.2-bcmath \ - php7.2-mbstring \ - php7.2-pear + php-curl \ + php-gd \ + php-pgsql \ + php-apcu \ + php-bcmath \ + php-mbstring \ + php-pear # Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index e4d53eebe..971928a6d 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -28,7 +28,7 @@ jobs: - name: Setup PHP with specific version uses: shivammathur/setup-php@v2 with: - php-version: '7.0' + php-version: '7.2' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - name: Install prerequisites run: sudo bash ./.github/scripts/install-bionic.sh @@ -41,14 +41,32 @@ jobs: sudo bash ./.github/scripts/python-pkg-install.sh sudo bash ./.github/scripts/python-pkg-test.sh # test-xenial: - # runs-on: ubuntu-16.04 - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v2 - # with: - # python-version: '3.5' - # - 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 + # runs-on: ubuntu-16.04 + # steps: + # - uses: actions/checkout@v2 + # - uses: actions/setup-python@v2 + # with: + # python-version: '3.5' + # - name: Setup PostgreSQL + # run: | + # sudo systemctl start postgresql.service + # pg_isready + # sudo -u postgres psql -c 'CREATE DATABASE libretime;' + # sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" + # sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' + # sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' + # - name: Setup PHP with specific version + # uses: shivammathur/setup-php@v2 + # with: + # php-version: '7.0' + # - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime + # - name: Install prerequisites + # run: sudo bash ./.github/scripts/install-xenial.sh + # - name: Run PHP tests + # run: | + # sudo composer install + # cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit && cd ../.. + # - name: Run Python tests + # run: | + # sudo bash ./.github/scripts/python-pkg-install.sh + # sudo bash ./.github/scripts/python-pkg-test.sh \ No newline at end of file From 29b853c813fec16abbaa0bb56b73a5fd3fdb73a4 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 15:16:12 -0500 Subject: [PATCH 30/60] Adding in ls for debugging --- .github/workflows/test-all-Ubuntu.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 971928a6d..e14eb98a0 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -35,7 +35,10 @@ jobs: - name: Run PHP tests run: | sudo composer install - cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit && cd ../.. + cd airtime_mvc/tests + ls ../../vendor/bin/phpunit + sudo bash ../../vendor/bin/phpunit + cd ../.. - name: Run Python tests run: | sudo bash ./.github/scripts/python-pkg-install.sh From 1758f3bf887622aa6e73f94dc75d2b683f008acd Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 15:28:43 -0500 Subject: [PATCH 31/60] Switch test to Xenial --- .github/workflows/test-all-Ubuntu.yml | 77 ++++++++++++++------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index e14eb98a0..3a6c79d87 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -10,13 +10,45 @@ on: workflow_dispatch: jobs: - test-bionic: - runs-on: ubuntu-18.04 + # test-bionic: + # runs-on: ubuntu-18.04 + # steps: + # - uses: actions/checkout@v2 + # - uses: actions/setup-python@v2 + # with: + # python-version: '3.6' + # - name: Setup PostgreSQL + # run: | + # sudo systemctl start postgresql.service + # pg_isready + # sudo -u postgres psql -c 'CREATE DATABASE libretime;' + # sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" + # sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' + # sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' + # - name: Setup PHP with specific version + # uses: shivammathur/setup-php@v2 + # with: + # php-version: '7.2' + # - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime + # - name: Install prerequisites + # run: sudo bash ./.github/scripts/install-bionic.sh + # - name: Run PHP tests + # run: | + # composer install + # cd airtime_mvc/tests + # sudo bash ../../vendor/bin/phpunit + # cd ../.. + # - name: Run Python tests + # run: | + # sudo bash ./.github/scripts/python-pkg-install.sh + # sudo bash ./.github/scripts/python-pkg-test.sh + test-xenial: + runs-on: ubuntu-16.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: '3.6' + python-version: '3.5' - name: Setup PostgreSQL run: | sudo systemctl start postgresql.service @@ -28,48 +60,17 @@ jobs: - name: Setup PHP with specific version uses: shivammathur/setup-php@v2 with: - php-version: '7.2' + php-version: '7.0' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - name: Install prerequisites - run: sudo bash ./.github/scripts/install-bionic.sh + run: sudo bash ./.github/scripts/install-xenial.sh - name: Run PHP tests run: | - sudo composer install + composer install cd airtime_mvc/tests - ls ../../vendor/bin/phpunit sudo bash ../../vendor/bin/phpunit cd ../.. - name: Run Python tests run: | sudo bash ./.github/scripts/python-pkg-install.sh - sudo bash ./.github/scripts/python-pkg-test.sh - # test-xenial: - # runs-on: ubuntu-16.04 - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v2 - # with: - # python-version: '3.5' - # - name: Setup PostgreSQL - # run: | - # sudo systemctl start postgresql.service - # pg_isready - # sudo -u postgres psql -c 'CREATE DATABASE libretime;' - # sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" - # sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' - # sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' - # - name: Setup PHP with specific version - # uses: shivammathur/setup-php@v2 - # with: - # php-version: '7.0' - # - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - # - name: Install prerequisites - # run: sudo bash ./.github/scripts/install-xenial.sh - # - name: Run PHP tests - # run: | - # sudo composer install - # cd airtime_mvc/tests && sudo bash ../../vendor/bin/phpunit && cd ../.. - # - name: Run Python tests - # run: | - # sudo bash ./.github/scripts/python-pkg-install.sh - # sudo bash ./.github/scripts/python-pkg-test.sh \ No newline at end of file + sudo bash ./.github/scripts/python-pkg-test.sh \ No newline at end of file From 314695f8f9c99d166c7aca5ea1e6d5fc17772723 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 16 Dec 2020 15:39:41 -0500 Subject: [PATCH 32/60] Reverting to Bionic tests, moving up Python tests --- .github/scripts/install-xenial.sh | 4 +- .github/workflows/test-all-Ubuntu.yml | 83 +++++++++++++-------------- 2 files changed, 42 insertions(+), 45 deletions(-) diff --git a/.github/scripts/install-xenial.sh b/.github/scripts/install-xenial.sh index 60412b82c..78a015df3 100644 --- a/.github/scripts/install-xenial.sh +++ b/.github/scripts/install-xenial.sh @@ -24,9 +24,7 @@ apt-get install -y gstreamer1.0-plugins-base \ pkg-config \ libcairo2-dev \ postgresql \ - postgresql-client - -apt-get install -y php7.0 \ + postgresql-client \ php7.0-curl \ php7.0-gd \ php7.0-pgsql \ diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 3a6c79d87..f0cc7786b 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -10,45 +10,13 @@ on: workflow_dispatch: jobs: - # test-bionic: - # runs-on: ubuntu-18.04 - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v2 - # with: - # python-version: '3.6' - # - name: Setup PostgreSQL - # run: | - # sudo systemctl start postgresql.service - # pg_isready - # sudo -u postgres psql -c 'CREATE DATABASE libretime;' - # sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" - # sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' - # sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' - # - name: Setup PHP with specific version - # uses: shivammathur/setup-php@v2 - # with: - # php-version: '7.2' - # - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - # - name: Install prerequisites - # run: sudo bash ./.github/scripts/install-bionic.sh - # - name: Run PHP tests - # run: | - # composer install - # cd airtime_mvc/tests - # sudo bash ../../vendor/bin/phpunit - # cd ../.. - # - name: Run Python tests - # run: | - # sudo bash ./.github/scripts/python-pkg-install.sh - # sudo bash ./.github/scripts/python-pkg-test.sh - test-xenial: - runs-on: ubuntu-16.04 + test-bionic: + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: '3.5' + python-version: '3.6' - name: Setup PostgreSQL run: | sudo systemctl start postgresql.service @@ -60,17 +28,48 @@ jobs: - name: Setup PHP with specific version uses: shivammathur/setup-php@v2 with: - php-version: '7.0' + php-version: '7.2' - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - name: Install prerequisites - run: sudo bash ./.github/scripts/install-xenial.sh + run: sudo bash ./.github/scripts/install-bionic.sh + - name: Run Python tests + run: | + sudo bash ./.github/scripts/python-pkg-install.sh + sudo bash ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | composer install cd airtime_mvc/tests sudo bash ../../vendor/bin/phpunit - cd ../.. - - name: Run Python tests - run: | - sudo bash ./.github/scripts/python-pkg-install.sh - sudo bash ./.github/scripts/python-pkg-test.sh \ No newline at end of file + # test-xenial: + # runs-on: ubuntu-16.04 + # steps: + # - uses: actions/checkout@v2 + # - uses: actions/setup-python@v2 + # with: + # python-version: '3.5' + # - name: Setup PostgreSQL + # run: | + # sudo systemctl start postgresql.service + # pg_isready + # sudo -u postgres psql -c 'CREATE DATABASE libretime;' + # sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" + # sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' + # sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' + # - name: Setup PHP with specific version + # uses: shivammathur/setup-php@v2 + # with: + # php-version: '7.0' + # - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime + # - name: Install prerequisites + # run: sudo bash ./.github/scripts/install-xenial.sh + # - name: Run Python tests + # run: | + # sudo bash ./.github/scripts/python-pkg-install.sh + # sudo bash ./.github/scripts/python-pkg-test.sh + # - name: Run PHP tests + # run: | + # composer install + # cd airtime_mvc/tests + # sudo bash ../../vendor/bin/phpunit + # cd ../.. \ No newline at end of file From 621a08dc741a1461a242af2469b3c8f0f3b46e9b Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 17 Dec 2020 09:36:07 -0500 Subject: [PATCH 33/60] Back to Xenial --- .github/workflows/test-all-Ubuntu.yml | 75 +++++++++++++-------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index f0cc7786b..b227ed0b4 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -10,44 +10,13 @@ on: workflow_dispatch: jobs: - test-bionic: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.6' - - name: Setup PostgreSQL - run: | - sudo systemctl start postgresql.service - pg_isready - sudo -u postgres psql -c 'CREATE DATABASE libretime;' - sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" - sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' - sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' - - name: Setup PHP with specific version - uses: shivammathur/setup-php@v2 - with: - php-version: '7.2' - - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - - name: Install prerequisites - run: sudo bash ./.github/scripts/install-bionic.sh - - name: Run Python tests - run: | - sudo bash ./.github/scripts/python-pkg-install.sh - sudo bash ./.github/scripts/python-pkg-test.sh - - name: Run PHP tests - run: | - composer install - cd airtime_mvc/tests - sudo bash ../../vendor/bin/phpunit - # test-xenial: - # runs-on: ubuntu-16.04 + # test-bionic: + # runs-on: ubuntu-18.04 # steps: # - uses: actions/checkout@v2 # - uses: actions/setup-python@v2 # with: - # python-version: '3.5' + # python-version: '3.6' # - name: Setup PostgreSQL # run: | # sudo systemctl start postgresql.service @@ -59,17 +28,47 @@ jobs: # - name: Setup PHP with specific version # uses: shivammathur/setup-php@v2 # with: - # php-version: '7.0' + # php-version: '7.2' # - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime # - name: Install prerequisites - # run: sudo bash ./.github/scripts/install-xenial.sh + # run: sudo bash ./.github/scripts/install-bionic.sh # - name: Run Python tests # run: | # sudo bash ./.github/scripts/python-pkg-install.sh # sudo bash ./.github/scripts/python-pkg-test.sh # - name: Run PHP tests # run: | - # composer install + # composer install --no-progress # cd airtime_mvc/tests # sudo bash ../../vendor/bin/phpunit - # cd ../.. \ No newline at end of file + test-xenial: + runs-on: ubuntu-16.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.5' + - name: Setup PostgreSQL + run: | + sudo systemctl start postgresql.service + pg_isready + sudo -u postgres psql -c 'CREATE DATABASE libretime;' + sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" + sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' + sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' + - name: Setup PHP with specific version + uses: shivammathur/setup-php@v2 + with: + php-version: '7.0' + - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime + - name: Install prerequisites + run: sudo bash ./.github/scripts/install-xenial.sh + - name: Run Python tests + run: | + sudo bash ./.github/scripts/python-pkg-install.sh + sudo bash ./.github/scripts/python-pkg-test.sh + - name: Run PHP tests + run: | + composer install --no-progress + cd airtime_mvc/tests + sudo bash ../../vendor/bin/phpunit \ No newline at end of file From 572a3a273c9710d2a007cee4ee03d9341f9852c6 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 17 Dec 2020 09:44:18 -0500 Subject: [PATCH 34/60] Updating Composer dependencies --- .github/scripts/install-xenial.sh | 2 -- .github/workflows/test-all-Ubuntu.yml | 3 ++- composer.json | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/scripts/install-xenial.sh b/.github/scripts/install-xenial.sh index 78a015df3..b89e397d2 100644 --- a/.github/scripts/install-xenial.sh +++ b/.github/scripts/install-xenial.sh @@ -23,8 +23,6 @@ apt-get install -y gstreamer1.0-plugins-base \ python-cairo \ pkg-config \ libcairo2-dev \ - postgresql \ - postgresql-client \ php7.0-curl \ php7.0-gd \ php7.0-pgsql \ diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index b227ed0b4..bb9d888c9 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -65,10 +65,11 @@ jobs: run: sudo bash ./.github/scripts/install-xenial.sh - name: Run Python tests run: | + pip3 install --upgrade pip sudo bash ./.github/scripts/python-pkg-install.sh sudo bash ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | - composer install --no-progress + composer install --no-progress --dev cd airtime_mvc/tests sudo bash ../../vendor/bin/phpunit \ No newline at end of file diff --git a/composer.json b/composer.json index a5cae5d09..093da408b 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,8 @@ "zf1s/zend-cache": "dev-master@dev" }, "require-dev": { - "phpunit/phpunit": "^4.3", - "phpunit/dbunit": "^2.0", + "phpunit/phpunit": "^6", + "phpunit/dbunit": "^3.0", "zf1s/zend-test": "^1.12" } } From b2e34e6bb1a5e0fd5e3be4e85a7a944dc3c10b03 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 17 Dec 2020 10:02:56 -0500 Subject: [PATCH 35/60] Switching to Github Action --- .github/workflows/test-all-Ubuntu.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index bb9d888c9..8345e2d10 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -68,8 +68,11 @@ jobs: pip3 install --upgrade pip sudo bash ./.github/scripts/python-pkg-install.sh sudo bash ./.github/scripts/python-pkg-test.sh - - name: Run PHP tests - run: | - composer install --no-progress --dev - cd airtime_mvc/tests - sudo bash ../../vendor/bin/phpunit \ No newline at end of file + - name: Install PHP dependencies + run: composer install --no-progress --dev + - name: PHPUnit tests + uses: php-actions/phpunit@v1 + with: + php_version: '7.0' + configuration: 'airtime_mvc/tests/phpunit.xml' + bootstrap: 'airtime_mvc/tests/application/bootstrap.php' \ No newline at end of file From 0f1da44a876e683896d623e0c532f2fe00225100 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 17 Dec 2020 10:15:09 -0500 Subject: [PATCH 36/60] Reaching brink of insanity --- .github/workflows/test-all-Ubuntu.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 8345e2d10..02ef5aa75 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -65,14 +65,11 @@ jobs: run: sudo bash ./.github/scripts/install-xenial.sh - name: Run Python tests run: | - pip3 install --upgrade pip + pip install --upgrade pip sudo bash ./.github/scripts/python-pkg-install.sh sudo bash ./.github/scripts/python-pkg-test.sh - - name: Install PHP dependencies - run: composer install --no-progress --dev - - name: PHPUnit tests - uses: php-actions/phpunit@v1 - with: - php_version: '7.0' - configuration: 'airtime_mvc/tests/phpunit.xml' - bootstrap: 'airtime_mvc/tests/application/bootstrap.php' \ No newline at end of file + - name: Run PHP tests + run: | + composer install --no-progress --dev + cd airtime_mvc/tests + sudo bash ../../vendor/bin/phpunit \ No newline at end of file From 1d4dfbf4393cee9a7e0bf1b322235120fdf71fd7 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 17 Dec 2020 11:11:11 -0500 Subject: [PATCH 37/60] Reverting composer dependencies --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 093da408b..a5cae5d09 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,8 @@ "zf1s/zend-cache": "dev-master@dev" }, "require-dev": { - "phpunit/phpunit": "^6", - "phpunit/dbunit": "^3.0", + "phpunit/phpunit": "^4.3", + "phpunit/dbunit": "^2.0", "zf1s/zend-test": "^1.12" } } From e67bf8545df1ab840ed8987579ea14a10bfe92bd Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 18 Dec 2020 09:16:08 -0500 Subject: [PATCH 38/60] Changing call on PHP script --- .github/scripts/python-pkg-test.sh | 4 ++-- .github/workflows/test-all-Ubuntu.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh index 5bb2c39d8..49c5caf78 100644 --- a/.github/scripts/python-pkg-test.sh +++ b/.github/scripts/python-pkg-test.sh @@ -3,10 +3,10 @@ # Starting at repo root cd python_apps/airtime_analyzer -nosetests . -x +nosetests . -x -e cd ../api_clients -nosetests . -x +nosetests . -x -e # Reset to repo root cd ../.. \ No newline at end of file diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 02ef5aa75..1a3fb27e6 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -72,4 +72,4 @@ jobs: run: | composer install --no-progress --dev cd airtime_mvc/tests - sudo bash ../../vendor/bin/phpunit \ No newline at end of file + php ../../vendor/bin/phpunit \ No newline at end of file From f1a58fc8cac20dffb81a3e1601365595f6906625 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 18 Dec 2020 09:20:13 -0500 Subject: [PATCH 39/60] Reverting Python testing --- .github/scripts/python-pkg-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh index 49c5caf78..5bb2c39d8 100644 --- a/.github/scripts/python-pkg-test.sh +++ b/.github/scripts/python-pkg-test.sh @@ -3,10 +3,10 @@ # Starting at repo root cd python_apps/airtime_analyzer -nosetests . -x -e +nosetests . -x cd ../api_clients -nosetests . -x -e +nosetests . -x # Reset to repo root cd ../.. \ No newline at end of file From a16739bb9b77c15609eabd0feb194d4ba5949c14 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 18 Dec 2020 09:35:54 -0500 Subject: [PATCH 40/60] Trying out cacheing --- .github/workflows/test-all-Ubuntu.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 1a3fb27e6..4ba993b25 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -60,14 +60,31 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '7.0' - - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - name: Install prerequisites - run: sudo bash ./.github/scripts/install-xenial.sh + run: | + ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime + sudo bash ./.github/scripts/install-xenial.sh + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- - name: Run Python tests run: | pip install --upgrade pip sudo bash ./.github/scripts/python-pkg-install.sh sudo bash ./.github/scripts/python-pkg-test.sh + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Run PHP tests run: | composer install --no-progress --dev From 752f354d0b0788ec4ac42a02a14ef6aec79bacd2 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 18 Dec 2020 09:39:27 -0500 Subject: [PATCH 41/60] Rearranging cacheing --- .github/workflows/test-all-Ubuntu.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 4ba993b25..8956812cf 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -64,17 +64,20 @@ jobs: run: | ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime sudo bash ./.github/scripts/install-xenial.sh - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - name: Run Python tests run: | pip install --upgrade pip sudo bash ./.github/scripts/python-pkg-install.sh sudo bash ./.github/scripts/python-pkg-test.sh + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + - name: Run PHP tests + run: | + composer install --no-progress --dev + cd airtime_mvc/tests + php ../../vendor/bin/phpunit - name: Get Composer Cache Directory id: composer-cache run: | @@ -83,10 +86,3 @@ jobs: with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - name: Run PHP tests - run: | - composer install --no-progress --dev - cd airtime_mvc/tests - php ../../vendor/bin/phpunit \ No newline at end of file From bbb909a4672125daa2c0a347a2b96657c9626a63 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 18 Dec 2020 09:46:27 -0500 Subject: [PATCH 42/60] Nevermind --- .github/workflows/test-all-Ubuntu.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 8956812cf..e125d0d91 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -69,20 +69,8 @@ jobs: pip install --upgrade pip sudo bash ./.github/scripts/python-pkg-install.sh sudo bash ./.github/scripts/python-pkg-test.sh - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - name: Run PHP tests run: | composer install --no-progress --dev cd airtime_mvc/tests - php ../../vendor/bin/phpunit - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + php ../../vendor/bin/phpunit \ No newline at end of file From 277297e3ba1583d6b5f2f67eb0581f805ea0acb8 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 18 Dec 2020 09:48:43 -0500 Subject: [PATCH 43/60] Adding back Bionic test --- .github/workflows/test-all-Ubuntu.yml | 62 +++++++++++++-------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index e125d0d91..b3c78c7b6 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -10,37 +10,37 @@ on: workflow_dispatch: jobs: - # test-bionic: - # runs-on: ubuntu-18.04 - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v2 - # with: - # python-version: '3.6' - # - name: Setup PostgreSQL - # run: | - # sudo systemctl start postgresql.service - # pg_isready - # sudo -u postgres psql -c 'CREATE DATABASE libretime;' - # sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" - # sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' - # sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' - # - name: Setup PHP with specific version - # uses: shivammathur/setup-php@v2 - # with: - # php-version: '7.2' - # - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - # - name: Install prerequisites - # run: sudo bash ./.github/scripts/install-bionic.sh - # - name: Run Python tests - # run: | - # sudo bash ./.github/scripts/python-pkg-install.sh - # sudo bash ./.github/scripts/python-pkg-test.sh - # - name: Run PHP tests - # run: | - # composer install --no-progress - # cd airtime_mvc/tests - # sudo bash ../../vendor/bin/phpunit + test-bionic: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.6' + - name: Setup PostgreSQL + run: | + sudo systemctl start postgresql.service + pg_isready + sudo -u postgres psql -c 'CREATE DATABASE libretime;' + sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" + sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' + sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;' + - name: Setup PHP with specific version + uses: shivammathur/setup-php@v2 + with: + php-version: '7.2' + - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime + - name: Install prerequisites + run: sudo bash ./.github/scripts/install-bionic.sh + - name: Run Python tests + run: | + sudo bash ./.github/scripts/python-pkg-install.sh + sudo bash ./.github/scripts/python-pkg-test.sh + - name: Run PHP tests + run: | + composer install --no-progress + cd airtime_mvc/tests + sudo bash ../../vendor/bin/phpunit test-xenial: runs-on: ubuntu-16.04 steps: From 1476b69abc4851ca0b44d1a000c73cc803cc5674 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 18 Dec 2020 11:23:21 -0500 Subject: [PATCH 44/60] Oops --- .github/workflows/test-all-Ubuntu.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index b3c78c7b6..8bfa7a586 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -29,18 +29,19 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '7.2' - - run: ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - name: Install prerequisites - run: sudo bash ./.github/scripts/install-bionic.sh + run: | + ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime + sudo bash ./.github/scripts/install-bionic.sh - name: Run Python tests run: | sudo bash ./.github/scripts/python-pkg-install.sh sudo bash ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | - composer install --no-progress + composer install --no-progress --dev cd airtime_mvc/tests - sudo bash ../../vendor/bin/phpunit + php ../../vendor/bin/phpunit test-xenial: runs-on: ubuntu-16.04 steps: From bd730c87e0e5c30f353843bd31229755aa11cec9 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 21 Dec 2020 14:42:55 -0500 Subject: [PATCH 45/60] @hairmare squashed bugs --- airtime_mvc/application/models/Preference.php | 2 +- .../tests/application/models/unit/PreferenceUnitTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index cbb256481..95beb0784 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -772,7 +772,7 @@ class Application_Model_Preference public static function GetImportTimestamp() { - return self::getValue("import_timestamp"); + return (int) self::getValue("import_timestamp"); } public static function GetStreamType() diff --git a/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php b/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php index c27f8453d..00b0d74d1 100644 --- a/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php +++ b/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php @@ -13,7 +13,7 @@ class PreferenceUnitTest extends PHPUnit_Framework_TestCase public function testSetShowsPopulatedUntil() { - $date = new DateTime(); + $date = new DateTime("2040-01-01T12:00:00.000000Z"); Application_Model_Preference::SetShowsPopulatedUntil($date); $this->assertEquals(Application_Model_Preference::GetShowsPopulatedUntil(), $date); } From 78e78243f7a7f0a677f6a884ccde665f29efa6cc Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Tue, 22 Dec 2020 10:22:46 -0500 Subject: [PATCH 46/60] Using fixed date in tests, removing extra dependencies --- .github/scripts/install-bionic.sh | 9 +-------- .github/scripts/install-xenial.sh | 9 +-------- .../tests/application/models/unit/ScheduleUnitTest.php | 4 ++-- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/scripts/install-bionic.sh b/.github/scripts/install-bionic.sh index 942c0a07e..ef7416abe 100644 --- a/.github/scripts/install-bionic.sh +++ b/.github/scripts/install-bionic.sh @@ -22,14 +22,7 @@ apt-get install -y gstreamer1.0-plugins-base \ python3-gi-cairo \ python-cairo \ pkg-config \ - libcairo2-dev \ - php-curl \ - php-gd \ - php-pgsql \ - php-apcu \ - php-bcmath \ - php-mbstring \ - php-pear + libcairo2-dev # Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/.github/scripts/install-xenial.sh b/.github/scripts/install-xenial.sh index b89e397d2..ef7416abe 100644 --- a/.github/scripts/install-xenial.sh +++ b/.github/scripts/install-xenial.sh @@ -22,14 +22,7 @@ apt-get install -y gstreamer1.0-plugins-base \ python3-gi-cairo \ python-cairo \ pkg-config \ - libcairo2-dev \ - php7.0-curl \ - php7.0-gd \ - php7.0-pgsql \ - php-apcu \ - php-bcmath \ - php-mbstring \ - php-pear + libcairo2-dev # Making directory; not sure why... mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php b/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php index 2c9921bf3..c29fa1e33 100644 --- a/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php +++ b/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php @@ -23,7 +23,7 @@ class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase //PHPUnit_Fr $testShowData = ShowServiceData::getNoRepeatNoRRData(); $showService = new Application_Service_ShowService(); - $futureDate = new DateTime(); + $futureDate = new DateTime('2040-01-01T12:00:00.012345Z'); $futureDate->add(new DateInterval('P1Y')); //1 year into the future $futureDateString = $futureDate->format('Y-m-d'); @@ -35,7 +35,7 @@ class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase //PHPUnit_Fr //value will prevent anything from actually being scheduled. Normally this isn't //a problem because as soon as you view the calendar for the first time, this is //set to a week ahead in the future. - $populateUntil = new DateTime("now", new DateTimeZone('UTC')); + $populateUntil = new DateTime('2040-01-01T12:00:00.012345Z', new DateTimeZone('UTC')); $populateUntil = $populateUntil->add(new DateInterval("P2Y")); //2 years ahead in the future. Application_Model_Preference::SetShowsPopulatedUntil($populateUntil); From 37be95e033e42eb8c9dce1849ee6572565184ee2 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Tue, 22 Dec 2020 14:50:21 -0500 Subject: [PATCH 47/60] Reverting --- .../tests/application/models/unit/ScheduleUnitTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php b/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php index c29fa1e33..2c9921bf3 100644 --- a/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php +++ b/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php @@ -23,7 +23,7 @@ class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase //PHPUnit_Fr $testShowData = ShowServiceData::getNoRepeatNoRRData(); $showService = new Application_Service_ShowService(); - $futureDate = new DateTime('2040-01-01T12:00:00.012345Z'); + $futureDate = new DateTime(); $futureDate->add(new DateInterval('P1Y')); //1 year into the future $futureDateString = $futureDate->format('Y-m-d'); @@ -35,7 +35,7 @@ class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase //PHPUnit_Fr //value will prevent anything from actually being scheduled. Normally this isn't //a problem because as soon as you view the calendar for the first time, this is //set to a week ahead in the future. - $populateUntil = new DateTime('2040-01-01T12:00:00.012345Z', new DateTimeZone('UTC')); + $populateUntil = new DateTime("now", new DateTimeZone('UTC')); $populateUntil = $populateUntil->add(new DateInterval("P2Y")); //2 years ahead in the future. Application_Model_Preference::SetShowsPopulatedUntil($populateUntil); From 359d351e20d6ce841cb95928a56c5f22a066b0f5 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 15:30:26 +0200 Subject: [PATCH 48/60] fail python test when tests fail --- .github/scripts/python-pkg-test.sh | 20 +++++++++++++++++--- .github/workflows/test-all-Ubuntu.yml | 6 +++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh index 5bb2c39d8..a6918a66c 100644 --- a/.github/scripts/python-pkg-test.sh +++ b/.github/scripts/python-pkg-test.sh @@ -1,12 +1,26 @@ #/bin/bash +failed='f' # Starting at repo root +echo "::group::Airtime Analyzer" cd python_apps/airtime_analyzer -nosetests . -x +if ! nosetests . -x; then + failed='t' +fi +echo "::endgroup" +echo "::group::API Client" cd ../api_clients -nosetests . -x +if ! nosetests . -x; then + failed='t' +fi +echo "::endgroup" # Reset to repo root -cd ../.. \ No newline at end of file +cd ../.. +if [[ "$failed" = "t" ]]; then + echo "Python tests failed" + exit 1 +fi +echo "Python tests passed!" diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 8bfa7a586..4c04677ed 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -8,7 +8,7 @@ on: paths-ignore: - 'docs/**' workflow_dispatch: - + jobs: test-bionic: runs-on: ubuntu-18.04 @@ -36,7 +36,7 @@ jobs: - name: Run Python tests run: | sudo bash ./.github/scripts/python-pkg-install.sh - sudo bash ./.github/scripts/python-pkg-test.sh + ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | composer install --no-progress --dev @@ -74,4 +74,4 @@ jobs: run: | composer install --no-progress --dev cd airtime_mvc/tests - php ../../vendor/bin/phpunit \ No newline at end of file + php ../../vendor/bin/phpunit From d3ed44388898d5fd95ecd14f3ed959fc0928c20c Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 15:32:58 +0200 Subject: [PATCH 49/60] do not fail fast --- .github/workflows/test-all-Ubuntu.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 4c04677ed..33fdd1326 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -12,6 +12,8 @@ on: jobs: test-bionic: runs-on: ubuntu-18.04 + strategy: + fail-fast: false steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -44,6 +46,8 @@ jobs: php ../../vendor/bin/phpunit test-xenial: runs-on: ubuntu-16.04 + strategy: + fail-fast: false steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -69,7 +73,7 @@ jobs: run: | pip install --upgrade pip sudo bash ./.github/scripts/python-pkg-install.sh - sudo bash ./.github/scripts/python-pkg-test.sh + ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | composer install --no-progress --dev From a720ad13e1ab470ab25158c0e58662b9a4f2886d Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 15:36:41 +0200 Subject: [PATCH 50/60] make scripts executable --- .github/scripts/install-bionic.sh | 0 .github/scripts/install-xenial.sh | 0 .github/scripts/python-pkg-install.sh | 0 .github/scripts/python-pkg-test.sh | 0 .github/scripts/release.sh | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/scripts/install-bionic.sh mode change 100644 => 100755 .github/scripts/install-xenial.sh mode change 100644 => 100755 .github/scripts/python-pkg-install.sh mode change 100644 => 100755 .github/scripts/python-pkg-test.sh mode change 100644 => 100755 .github/scripts/release.sh diff --git a/.github/scripts/install-bionic.sh b/.github/scripts/install-bionic.sh old mode 100644 new mode 100755 diff --git a/.github/scripts/install-xenial.sh b/.github/scripts/install-xenial.sh old mode 100644 new mode 100755 diff --git a/.github/scripts/python-pkg-install.sh b/.github/scripts/python-pkg-install.sh old mode 100644 new mode 100755 diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh old mode 100644 new mode 100755 diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh old mode 100644 new mode 100755 From 29086efd9b080189e9ea533875d5c5ef694f4900 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 15:41:06 +0200 Subject: [PATCH 51/60] install nose --- .github/scripts/python-pkg-install.sh | 3 ++- .github/scripts/python-pkg-test.sh | 4 ++-- .github/workflows/test-all-Ubuntu.yml | 19 +++++++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/scripts/python-pkg-install.sh b/.github/scripts/python-pkg-install.sh index 861bf47cf..b0d6777ab 100755 --- a/.github/scripts/python-pkg-install.sh +++ b/.github/scripts/python-pkg-install.sh @@ -1,6 +1,7 @@ #/bin/bash +pip3 install nose 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 +pip3 install -e python_apps/pypo/. diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh index a6918a66c..55f1249c2 100755 --- a/.github/scripts/python-pkg-test.sh +++ b/.github/scripts/python-pkg-test.sh @@ -8,14 +8,14 @@ cd python_apps/airtime_analyzer if ! nosetests . -x; then failed='t' fi -echo "::endgroup" +echo "::endgroup::" echo "::group::API Client" cd ../api_clients if ! nosetests . -x; then failed='t' fi -echo "::endgroup" +echo "::endgroup::" # Reset to repo root cd ../.. diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 33fdd1326..4f57df8a4 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -14,6 +14,9 @@ jobs: runs-on: ubuntu-18.04 strategy: fail-fast: false + env: + ENVIRONMENT: testing + LIBRETIME_LOG_DIR: /tmp/log/libretime steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -32,12 +35,11 @@ jobs: with: php-version: '7.2' - name: Install prerequisites - run: | - ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - sudo bash ./.github/scripts/install-bionic.sh + run: + sudo ./.github/scripts/install-bionic.sh - name: Run Python tests run: | - sudo bash ./.github/scripts/python-pkg-install.sh + sudo ./.github/scripts/python-pkg-install.sh ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | @@ -48,6 +50,9 @@ jobs: runs-on: ubuntu-16.04 strategy: fail-fast: false + env: + ENVIRONMENT: testing + LIBRETIME_LOG_DIR: /tmp/log/libretime steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -66,13 +71,11 @@ jobs: with: php-version: '7.0' - name: Install prerequisites - run: | - ENVIRONMENT=testing && LIBRETIME_LOG_DIR=/tmp/log/libretime - sudo bash ./.github/scripts/install-xenial.sh + run: sudo ./.github/scripts/install-xenial.sh - name: Run Python tests run: | pip install --upgrade pip - sudo bash ./.github/scripts/python-pkg-install.sh + sudo ./.github/scripts/python-pkg-install.sh ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | From ed8366cf58c900225d849881ff9f41e796cd0eda Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 15:45:05 +0200 Subject: [PATCH 52/60] install mock --- .github/scripts/python-pkg-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/python-pkg-install.sh b/.github/scripts/python-pkg-install.sh index b0d6777ab..6b3c3ff70 100755 --- a/.github/scripts/python-pkg-install.sh +++ b/.github/scripts/python-pkg-install.sh @@ -1,5 +1,5 @@ #/bin/bash -pip3 install nose +pip3 install nose mock pip3 install -e python_apps/airtime_analyzer/. pip3 install -e python_apps/airtime-celery/. From 6f6d90fad7516e7561a0a2619ec3f8606698933d Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 16:15:50 +0200 Subject: [PATCH 53/60] update replaygain values --- .github/workflows/test-all-Ubuntu.yml | 6 +----- .../airtime_analyzer/tests/replaygain_analyzer_tests.py | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 4f57df8a4..3abe6b3ed 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -12,8 +12,6 @@ on: jobs: test-bionic: runs-on: ubuntu-18.04 - strategy: - fail-fast: false env: ENVIRONMENT: testing LIBRETIME_LOG_DIR: /tmp/log/libretime @@ -48,8 +46,6 @@ jobs: php ../../vendor/bin/phpunit test-xenial: runs-on: ubuntu-16.04 - strategy: - fail-fast: false env: ENVIRONMENT: testing LIBRETIME_LOG_DIR: /tmp/log/libretime @@ -57,7 +53,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: '3.5' + python-version: '3.6' - name: Setup PostgreSQL run: | sudo systemctl start postgresql.service diff --git a/python_apps/airtime_analyzer/tests/replaygain_analyzer_tests.py b/python_apps/airtime_analyzer/tests/replaygain_analyzer_tests.py index cc988d652..3d1269cb7 100644 --- a/python_apps/airtime_analyzer/tests/replaygain_analyzer_tests.py +++ b/python_apps/airtime_analyzer/tests/replaygain_analyzer_tests.py @@ -13,8 +13,8 @@ def check_default_metadata(metadata): assert abs(metadata['cuein']) < tolerance_seconds assert abs(metadata['cueout'] - length_seconds) < tolerance_seconds ''' - tolerance = 0.30 - expected_replaygain = 5.0 + tolerance = 0.60 + expected_replaygain = 5.2 print(metadata['replay_gain']) assert abs(metadata['replay_gain'] - expected_replaygain) < tolerance @@ -27,7 +27,6 @@ def test_missing_replaygain(): def test_invalid_filepath(): metadata = ReplayGainAnalyzer.analyze(u'non-existent-file', dict()) - def test_mp3_utf8(): metadata = ReplayGainAnalyzer.analyze(u'tests/test_data/44100Hz-16bit-stereo-utf8.mp3', dict()) check_default_metadata(metadata) From 6193d80e2ad2d4b22172a2ba7ccec0823716850f Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 16:22:50 +0200 Subject: [PATCH 54/60] group install steps --- .github/scripts/python-pkg-install.sh | 2 ++ .github/workflows/test-all-Ubuntu.yml | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/scripts/python-pkg-install.sh b/.github/scripts/python-pkg-install.sh index 6b3c3ff70..55e02aeb6 100755 --- a/.github/scripts/python-pkg-install.sh +++ b/.github/scripts/python-pkg-install.sh @@ -1,7 +1,9 @@ #/bin/bash +echo "::group::Install Python apps" pip3 install nose mock 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/. +echo "::endgroup::" diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 3abe6b3ed..b79d435af 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: '3.6' + python-version: '3.5' - name: Setup PostgreSQL run: | sudo systemctl start postgresql.service @@ -70,11 +70,13 @@ jobs: run: sudo ./.github/scripts/install-xenial.sh - name: Run Python tests run: | - pip install --upgrade pip + pip3 install --upgrade pip sudo ./.github/scripts/python-pkg-install.sh ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | + echo "::group::Install PHP dependencies" composer install --no-progress --dev + echo "::endgroup::" cd airtime_mvc/tests php ../../vendor/bin/phpunit From f095c3012760fef0ed33e09fa3cb64820f649f0a Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 16:24:50 +0200 Subject: [PATCH 55/60] drop bad PHP test --- .../services/database/ShowServiceDbTest.php | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php b/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php index cea84434f..82facc123 100644 --- a/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php +++ b/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php @@ -463,29 +463,6 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase } /** Test the creation of a weekly repeating, record and rebroadcast(RR) show **/ - public function testCreateWeeklyRepeatRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatRRData(); - $showService = new Application_Service_ShowService(null, $data); - $showService->addUpdateShow($data); - - $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet( - $this->getConnection() - ); - $ds->addTable('cc_show', 'select * from cc_show'); - $ds->addTable('cc_show_days', 'select * from cc_show_days'); - $ds->addTable('cc_show_instances', 'select id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance from cc_show_instances'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createWeeklyRepeatRRShow.yml"), - $ds - ); - } - public function testEditRepeatingShowChangeNoEndOption() { TestHelper::loginUser(); From 629d1d451b771d5a737e1fee010788e5091f4ddf Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 16:29:39 +0200 Subject: [PATCH 56/60] set log dir permissions --- .github/scripts/install-bionic.sh | 5 +++-- .github/scripts/install-xenial.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/install-bionic.sh b/.github/scripts/install-bionic.sh index ef7416abe..925ef9364 100755 --- a/.github/scripts/install-bionic.sh +++ b/.github/scripts/install-bionic.sh @@ -24,5 +24,6 @@ apt-get install -y gstreamer1.0-plugins-base \ pkg-config \ libcairo2-dev -# Making directory; not sure why... -mkdir -p /tmp/log/libretime \ No newline at end of file +# Making log directory for PHP tests +mkdir -p $LIBRETIME_LOG_DIR +chown runner:runner $LIBRETIME_LOG_DIR diff --git a/.github/scripts/install-xenial.sh b/.github/scripts/install-xenial.sh index ef7416abe..925ef9364 100755 --- a/.github/scripts/install-xenial.sh +++ b/.github/scripts/install-xenial.sh @@ -24,5 +24,6 @@ apt-get install -y gstreamer1.0-plugins-base \ pkg-config \ libcairo2-dev -# Making directory; not sure why... -mkdir -p /tmp/log/libretime \ No newline at end of file +# Making log directory for PHP tests +mkdir -p $LIBRETIME_LOG_DIR +chown runner:runner $LIBRETIME_LOG_DIR From e63fa940dfc23ca83833f5c67b1d38b252409f56 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 16:33:50 +0200 Subject: [PATCH 57/60] pass environment to step --- .github/workflows/test-all-Ubuntu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index b79d435af..7c7a3bbb5 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -34,7 +34,7 @@ jobs: php-version: '7.2' - name: Install prerequisites run: - sudo ./.github/scripts/install-bionic.sh + sudo -E ./.github/scripts/install-bionic.sh - name: Run Python tests run: | sudo ./.github/scripts/python-pkg-install.sh @@ -67,7 +67,7 @@ jobs: with: php-version: '7.0' - name: Install prerequisites - run: sudo ./.github/scripts/install-xenial.sh + run: sudo -E ./.github/scripts/install-xenial.sh - name: Run Python tests run: | pip3 install --upgrade pip From c7c62b1268e2948e8749073d75d923a6ed51a2a3 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 16:40:29 +0200 Subject: [PATCH 58/60] drop Python tests on xenial --- .github/workflows/test-all-Ubuntu.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 7c7a3bbb5..0e45783bd 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -44,16 +44,13 @@ jobs: composer install --no-progress --dev cd airtime_mvc/tests php ../../vendor/bin/phpunit - test-xenial: + test-xenial-php: runs-on: ubuntu-16.04 env: ENVIRONMENT: testing LIBRETIME_LOG_DIR: /tmp/log/libretime steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.5' - name: Setup PostgreSQL run: | sudo systemctl start postgresql.service @@ -68,11 +65,6 @@ jobs: php-version: '7.0' - name: Install prerequisites run: sudo -E ./.github/scripts/install-xenial.sh - - name: Run Python tests - run: | - pip3 install --upgrade pip - sudo ./.github/scripts/python-pkg-install.sh - ./.github/scripts/python-pkg-test.sh - name: Run PHP tests run: | echo "::group::Install PHP dependencies" From ca28cc517083c5bb559fab86f4539c04635554f9 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 16:45:29 +0200 Subject: [PATCH 59/60] make release on tags draft --- .github/scripts/release.sh | 4 ---- .github/workflows/package-release.yml | 15 +++++++++------ .../workflows/{test-all-Ubuntu.yml => test.yml} | 0 3 files changed, 9 insertions(+), 10 deletions(-) rename .github/workflows/{test-all-Ubuntu.yml => test.yml} (100%) diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh index f54c586e3..e1c53d6f9 100755 --- a/.github/scripts/release.sh +++ b/.github/scripts/release.sh @@ -25,10 +25,6 @@ fi echo "Creating tarball for LibreTime ${suffix}." -# Adding dos2unix package -apt update -y -q -apt install dos2unix php composer -y - echo -n "Creating VERSION file for ${suffix}..." echo -n "${suffix}" > ./VERSION echo " Done" diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 7289dcc82..3519fe523 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -29,17 +29,20 @@ jobs: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} body: ${ steps.release_notes_file.outputs.contents } - draft: false - prerelease: false - - name: Build project # This would actually build your project - run: sudo bash ./.github/scripts/release.sh ${{ github.ref }} + draft: true + prerelease: true + - name: Build project + run: |- + sudo apt update -y -q + sudo apt install dos2unix php composer -y + ./.github/scripts/release.sh ${{ github.ref }} - name: Upload Release Asset - id: upload-release-asset + id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ../libretime-${{ github.ref }}.tar.gz asset_name: libretime-${{ github.ref }}.tar.gz asset_content_type: application/tgz diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/test-all-Ubuntu.yml rename to .github/workflows/test.yml From b6d83d9b9b437cd19d2bfc251b4d8b80b3474849 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 16:49:40 +0200 Subject: [PATCH 60/60] install for all python apps --- .github/scripts/python-pkg-install.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/scripts/python-pkg-install.sh b/.github/scripts/python-pkg-install.sh index 55e02aeb6..f2ea20314 100755 --- a/.github/scripts/python-pkg-install.sh +++ b/.github/scripts/python-pkg-install.sh @@ -2,8 +2,7 @@ echo "::group::Install Python apps" pip3 install nose mock -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/. +for app in `ls python_apps`; do + pip3 install -e python_apps/$app +done echo "::endgroup::"