switch back to webpack #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: phpunit | |
on: | |
push: | |
branches: [ main, test ] | |
pull_request: | |
branches: [ main ] | |
env: | |
APP_ID: gpxpod | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: ['8.1', '8.2', '8.3'] | |
databases: ['sqlite', 'mysql', 'pgsql'] | |
server-versions: ['stable30', 'master'] | |
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} | |
services: | |
postgres: | |
image: postgres:14 | |
ports: | |
- 4445:5432/tcp | |
env: | |
POSTGRES_USER: root | |
POSTGRES_PASSWORD: rootpassword | |
POSTGRES_DB: nextcloud | |
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5 | |
mysql: | |
image: mariadb:10.5 | |
ports: | |
- 4444:3306/tcp | |
env: | |
MYSQL_ROOT_PASSWORD: rootpassword | |
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Use Node 20 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, intl, sqlite3, curl, xml, json, zip, gd | |
ini-values: post_max_size=256M, max_execution_time=180 | |
coverage: xdebug | |
tools: php-cs-fixer | |
- uses: actions/checkout@v2 | |
- name: Setup Nextcloud | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
#sudo apt update -y | |
#sudo apt install python3-pip git sudo unzip curl wget sed make rsync gpsbabel -y | |
sudo -H pip3 install anybadge | |
mkdir -p ~/html | |
echo "git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.server-versions }} ~/html/nextcloud" | |
git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.server-versions }} ~/html/nextcloud | |
sed -i $'s|if (substr($fullPath, 0, strlen($root) + 1) === $root . \'/\')|if (is_string($root) and substr($fullPath, 0, strlen($root) + 1) === $root . \'/\')|g' ~/html/nextcloud/lib/autoloader.php | |
cp -r $GITHUB_WORKSPACE ~/html/nextcloud/apps/${{ env.APP_ID }} | |
# SETUP NEXTCLOUD | |
if [ "${{ matrix.databases }}" = "mysql" ]; then | |
export DB_PORT=4444 | |
elif [ "${{ matrix.databases }}" = "pgsql" ]; then | |
export DB_PORT=4445 | |
fi | |
echo "php ~/html/nextcloud/occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin" | |
php ~/html/nextcloud/occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin | |
cd ~/html/nextcloud/apps/${{ env.APP_ID }} | |
composer install --prefer-dist | |
php ~/html/nextcloud/occ app:enable --force ${{ env.APP_ID }} | |
php ~/html/nextcloud/occ maintenance:mode --off | |
echo "##### App is installed" | |
- name: Perform PhpUnit tests | |
run: | | |
cd ~/html/nextcloud/apps/${{ env.APP_ID }} | |
composer run test:unit && SUCCESS=yes || SUCCESS=no | |
if [ $SUCCESS = "yes" ]; then echo "TESTS PASSED"; else echo "TESTS FAILED"; exit 1; fi | |