From e3ca56c2f418bf786b675afd7894d4b18a749691 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 18:36:26 +0100 Subject: [PATCH 01/45] ci: test with github action --- .github/workflows/build.yml | 94 ++++++ .../workflows/calibreapp-image-actions.yml | 21 ++ .github/workflows/codeql-analysis.yml | 50 --- .github/workflows/cypress.yml | 87 ++--- .github/workflows/migration_tests.yml | 86 +++++ .github/workflows/release.yml | 1 + .github/workflows/static.yml | 81 +++++ .github/workflows/tests.yml | 304 ++++++++++++++++++ phpunit.xml | 55 ++-- scripts/ci/.env.jenkins.mysql | 15 - scripts/ci/.env.mysql | 32 +- 11 files changed, 683 insertions(+), 143 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/calibreapp-image-actions.yml delete mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/migration_tests.yml create mode 100644 .github/workflows/static.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 scripts/ci/.env.jenkins.mysql diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..9bc4079c76b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,94 @@ +name: Build and test + +on: + push: + branches: [master] + pull_request: + types: [opened, synchronize, reopened] + branches-ignore: ['l10n_master*'] + release: + types: [created] + + workflow_run: + workflows: ['Compress images'] + types: [completed] + +jobs: + ############# + # Build + ############# + build: + runs-on: ubuntu-latest + name: Build (PHP ${{ matrix.php-version }}) + + strategy: + fail-fast: false + matrix: + php-version: [7.4] + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring, dom, fileinfo, ${{ matrix.connection }} + coverage: none + - name: Check PHP Version + run: php -v + - name: Check Composer Version + run: composer -V + - name: Check PHP Extensions + run: php -m + + # Composer + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer files + uses: actions/cache@v2.1.4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + ${{ runner.os }}-composer-${{ matrix.php-version }} + ${{ runner.os }}-composer- + + - name: Install composer dependencies + run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php + + # Yarn + - name: Get yarn cache directory path + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Cache yarn files + uses: actions/cache@v2.1.4 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-yarn- + + - name: Install yarn dependencies + run: yarn inst + - name: Lint files + run: yarn run lint:all + - name: Build assets + run: yarn run production + + - name: Check if there is any file update needed + run: | + status=$(git status --porcelain) + if [ -z "$status" ]; then + echo "Nothing to push, already up to date." + else + echo -e "Waiting modifications:\n$status" + exit -1 + fi diff --git a/.github/workflows/calibreapp-image-actions.yml b/.github/workflows/calibreapp-image-actions.yml new file mode 100644 index 00000000000..9aac129135d --- /dev/null +++ b/.github/workflows/calibreapp-image-actions.yml @@ -0,0 +1,21 @@ +name: Compress images + +on: + pull_request: + paths: + - '**.jpg' + - '**.png' + - '**.webp' + +jobs: + build: + name: calibreapp/image-actions + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Compress Images + uses: calibreapp/image-actions@2 + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 5d83e819109..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: "Code scanning - action" - -on: - schedule: - - cron: '0 7 * * 0' - -jobs: - CodeQL-Build: - - # CodeQL runs on ubuntu-latest and windows-latest - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - # Override language selection by uncommenting this and choosing your languages - with: - languages: javascript - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 3375de3f1ac..bd9e105af76 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -14,8 +14,10 @@ jobs: mysql: image: mysql:5.7 env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_ALLOW_EMPTY_PASSWORD: true + MYSQL_USER: monica MYSQL_DATABASE: monica + MYSQL_PASSWORD: secret ports: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 @@ -26,7 +28,6 @@ jobs: php-version: [7.4] browser: [chrome] containers: [1, 2, 3, 4, 5, 6, 7, 8] - max-parallel: 10 steps: - name: Checkout sources @@ -45,14 +46,7 @@ jobs: - name: Check PHP Extensions run: php -m - # step-prepare-environment - - name: Prepare environment - run: | - mkdir -p results/coverage - cp scripts/ci/.env.mysql .env - touch .sentry-release - echo "REQUIRES_SUBSCRIPTION=true" >> .env - + # Composer - name: Validate composer.json and composer.lock run: composer validate @@ -62,48 +56,65 @@ jobs: - name: Cache composer files uses: actions/cache@v2.1.4 with: - path: ${{ steps.composer-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + ${{ runner.os }}-composer-${{ matrix.php-version }} ${{ runner.os }}-composer- - - name: Install dependencies - run: composer install --no-interaction --ignore-platform-reqs - - # step-prepare-db - - name: Prepare db - run: mysql -h 127.0.0.1 -u root -P 3306 monica < scripts/database.test.sql - - name: Run migration scripts - run: php artisan migrate --no-interaction -vvv - - # step-seed-test-db - - name: Seed database - run: | - php artisan db:seed --no-interaction -vvv - php artisan passport:keys --no-interaction -vvv + - name: Install composer dependencies + run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php + # Yarn - name: Get yarn cache directory path - id: yarn-cache-dir-path + id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2.1.4 + - name: Cache yarn files + uses: actions/cache@v2.1.4 with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} ${{ runner.os }}-yarn- - - name: yarn install + - name: Install yarn dependencies run: yarn inst - - name: yarn build + - name: Build assets run: yarn run production - - name: Cypress verify - run: npm run cy:verify - - name: which google-chrome + # Prepare + - name: Prepare environment run: | - which google-chrome || true - - uses: cypress-io/github-action@v1 + mkdir -p results/coverage + cp scripts/ci/.env.mysql .env + touch config/.version config/.release .sentry-release .sentry-commit + echo "REQUIRES_SUBSCRIPTION=true" >> .env + + - name: Generate key + run: php artisan key:generate + + - name: Prepare db + run: mysql -h 127.0.0.1 -u monica -psecret -P 3306 monica < scripts/database.test.sql + - name: Run migration scripts + run: php artisan migrate --no-interaction -vvv + + - name: Run seeds + run: php artisan db:seed --no-interaction -vvv + - name: Create passport keys + run: php artisan passport:keys --no-interaction -vvv + + + # Cypress + - name: Cypress verify + run: npx cypress verify + + - name: Find google-chrome + run: which google-chrome || true + - uses: cypress-io/github-action@v2 + id: cypress + continue-on-error: true with: start: php artisan serve browser: ${{ matrix.browser }} @@ -111,7 +122,7 @@ jobs: record: true parallel: true install: false - group: Azure DevOps CI ${{ matrix.browser }} + group: github action ${{ matrix.browser }} tag: ${{ github.event_name }} config: baseUrl=http://localhost:8000 wait-on: http://localhost:8000 diff --git a/.github/workflows/migration_tests.yml b/.github/workflows/migration_tests.yml new file mode 100644 index 00000000000..72ad4dc0748 --- /dev/null +++ b/.github/workflows/migration_tests.yml @@ -0,0 +1,86 @@ +name: Migration tests + +on: + push: + branches: [master] + pull_request: + types: [opened, synchronize, reopened] + branches-ignore: ['l10n_master*'] + release: + types: [created] + + workflow_run: + workflows: ['Compress images'] + types: [completed] + +jobs: + ##################### + # Run tests migration + ##################### + tests_migration: + runs-on: ubuntu-latest + name: Test migration on ${{ matrix.connection }} (PHP ${{ matrix.php-version }}) + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: true + MYSQL_USER: monica + MYSQL_DATABASE: monica + MYSQL_PASSWORD: secret + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: false + matrix: + php-version: [7.4] + connection: [mysql] + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring, dom, fileinfo, ${{ matrix.connection }} + coverage: none + - name: Check PHP Version + run: php -v + - name: Check Composer Version + run: composer -V + - name: Check PHP Extensions + run: php -m + + # Composer + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer files + uses: actions/cache@v2.1.4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + ${{ runner.os }}-composer-${{ matrix.php-version }} + ${{ runner.os }}-composer- + + - name: Install composer dependencies + run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php + + # Prepare + - name: Prepare environment + run: cp scripts/ci/.env.${{ matrix.connection }} .env + + - name: Run migrations + run: php artisan migrate --no-interaction -vvv + - name: Run seeds + run: php artisan db:seed --no-interaction -vvv diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 043b3ee72c9..54412e32eb9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,6 +90,7 @@ jobs: restore-keys: | ${{ runner.os }}-composer-${{ env.php-version }}-${{ hashFiles('**/composer.lock') }} ${{ runner.os }}-composer-${{ env.php-version }} + ${{ runner.os }}-composer- # Yarn - name: Get yarn cache directory path diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 00000000000..1cc2bde390e --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,81 @@ +name: Static analysis + +on: + pull_request: + types: [opened, synchronize, reopened] + + workflow_run: + workflows: ['Compress images'] + types: [completed] + +jobs: + psalm: + runs-on: ubuntu-latest + strategy: + matrix: + php-version: [7.4] + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer files + uses: actions/cache@v2.1.4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + ${{ runner.os }}-composer-${{ matrix.php-version }} + ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + + - name: Run psalm + run: vendor/bin/psalm --output-format=github + + + phpstan: + runs-on: ubuntu-latest + strategy: + matrix: + php-version: [7.4] + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer files + uses: actions/cache@v2.1.4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + ${{ runner.os }}-composer-${{ matrix.php-version }} + ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + + - name: Run phpstan + run: vendor/bin/phpstan analyse diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000000..03101e928d4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,304 @@ +name: Tests and report + +on: + push: + branches: [master] + pull_request: + types: [opened, synchronize, reopened] + branches-ignore: ['l10n_master*'] + release: + types: [created] + + workflow_run: + workflows: ['Compress images'] + types: [completed] + +jobs: + ############# + # Run tests + ############# + tests: + runs-on: ubuntu-latest + name: Test on ${{ matrix.connection }} (PHP ${{ matrix.php-version }}) + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: true + MYSQL_USER: monica + MYSQL_DATABASE: monica + MYSQL_PASSWORD: secret + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: false + matrix: + php-version: [7.4, 8.0] + connection: [mysql] + testsuite: [Api, Feature, Unit-Models, Unit-Services] + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring, dom, fileinfo, ${{ matrix.connection }} + coverage: none + - name: Check PHP Version + run: php -v + - name: Check Composer Version + run: composer -V + - name: Check PHP Extensions + run: php -m + + # Composer + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer files + uses: actions/cache@v2.1.4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + ${{ runner.os }}-composer-${{ matrix.php-version }} + ${{ runner.os }}-composer- + + - name: Install composer dependencies + run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php + + # Prepare + - name: Prepare environment + run: | + cp scripts/ci/.env.${{ matrix.connection }} .env + touch config/.version config/.release .sentry-release .sentry-commit + echo '{"/js/app.js": "/js/app.js", "/css/app.css": "/css/app.css"}' > public/mix-manifest.json + mkdir -p public/js + echo '' > public/js/app.js + mkdir -p public/css + echo '' > public/css/app.css + + - name: Generate key + run: php artisan key:generate + + - name: Prepare db + run: mysql -h 127.0.0.1 -u monica -psecret -P 3306 monica < scripts/database.test.sql + - name: Run migrations + run: php artisan migrate --no-interaction -vvv + + - name: Run seeds + run: php artisan db:seed --no-interaction -vvv + - name: Create passport keys + run: php artisan passport:keys --no-interaction -vvv + + # Test + - name: Run Unit test suite + run: | + php artisan route:cache + phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --testsuite ${{ matrix.testsuite }} --log-junit ./results/junit/results${{ github.run_number }}.xml --coverage-clover ./results/coverage${{ github.run_number }}.xml + env: + DB_CONNECTION: ${{ matrix.connection }} + + - name: Fix results files + run: sed -i -e "s%$GITHUB_WORKSPACE/%%g" results/*/*.xml + + - name: Store results + if: matrix.php-version == '7.4' + uses: actions/upload-artifact@v2 + with: + name: results${{ github.run_number }} + path: results + + + ################### + # Run tests browser + ################### + tests_browser: + runs-on: ubuntu-latest + name: Test browser on ${{ matrix.connection }} (PHP ${{ matrix.php-version }}) + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: true + MYSQL_USER: monica + MYSQL_DATABASE: monica + MYSQL_PASSWORD: secret + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: false + matrix: + php-version: [7.4] + connection: [mysql] + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring, dom, fileinfo, ${{ matrix.connection }} + coverage: none + - name: Check PHP Version + run: php -v + - name: Check Composer Version + run: composer -V + - name: Check PHP Extensions + run: php -m + + # Composer + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer files + uses: actions/cache@v2.1.4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + ${{ runner.os }}-composer-${{ matrix.php-version }} + ${{ runner.os }}-composer- + + - name: Install composer dependencies + run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php + + # Yarn + - name: Get yarn cache directory path + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Cache yarn files + uses: actions/cache@v2.1.4 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + ${{ runner.os }}-yarn- + + - name: Install yarn dependencies + run: yarn inst + - name: Build assets + run: yarn run production + + # Prepare + - name: Prepare environment + run: | + cp scripts/ci/.env.${{ matrix.connection }} .env + touch config/.version config/.release .sentry-release .sentry-commit + + - name: Generate key + run: php artisan key:generate + + - name: Prepare db + run: mysql -h 127.0.0.1 -u monica -psecret -P 3306 monica < scripts/database.test.sql + - name: Run migrations + run: php artisan migrate --no-interaction -vvv + + - name: Run seeds + run: php artisan db:seed --no-interaction -vvv + - name: Create passport keys + run: php artisan passport:keys --no-interaction -vvv + + # Test + - name: Launch google chrome + run: | + echo "##vso[task.setvariable variable=DISPLAY]$DISPLAY" + Xvfb ${DISPLAY} -screen 0 1920x1080x24 & + php artisan dusk:chrome-driver $(google-chrome -version | awk '{ print $3 }' | cut -d . -f 1) + ./vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 & + env: + DISPLAY: ':99' + + - name: Run http server + run: | + php -S localhost:8000 -t public scripts/tests/server-cc.php & + php -S localhost:8001 -t public scripts/tests/server-cc.php & + + - name: Run browser tests + run: php artisan dusk --log-junit results/junit/results0.xml + env: + CHROME_DRIVER_OPTS: --headless --disable-gpu --disable-dev-shm-usage --no-sandbox --remote-debugging-port=9222 --window-size=1920,1080 + - name: Fix coverage + run: | + vendor/bin/phpcov merge --clover=results/coverage0.xml results/coverage/ + rm -rf results/coverage + + - name: Store results + uses: actions/upload-artifact@v2 + with: + name: results0 + path: results + + + ########################### + # Reporting to sonarcloud + ########################### + reporting: + needs: [tests, tests_browser] + runs-on: ubuntu-latest + name: Sonarcloud + if: ${{ ! startsWith(github.ref, 'dependabot/') }} + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - name: Checkout HEAD + if: github.event_name == 'pull_request' + run: git checkout HEAD^2 + + - name: Download results + uses: actions/download-artifact@v2 + with: + path: results + + - name: Fix results paths + run: | + pushd results + for f in $(ls); do cp -rf $f/* .; rm -rf $f; done + + - name: Merge junit files + run: | + yarn global add junit-merge + $(yarn global bin)/junit-merge --recursive --dir results/junit --out results/results.xml + + - name: Set version parameter + id: version + run: | + version=$(git tag --points-at HEAD) + test -z "$version" && version="main" + echo "::set-output name=value::$version" + + - name: SonarCloud Scan + if: env.SONAR_TOKEN != '' + uses: SonarSource/sonarcloud-github-action@v1.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: | + -Dsonar.projectVersion=${{ steps.version.outputs.value }} diff --git a/phpunit.xml b/phpunit.xml index 4bab4269dc7..34a6cd7f434 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,15 +1,15 @@ - + ./tests/Api @@ -44,21 +44,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/scripts/ci/.env.jenkins.mysql b/scripts/ci/.env.jenkins.mysql deleted file mode 100644 index e76ac9525e5..00000000000 --- a/scripts/ci/.env.jenkins.mysql +++ /dev/null @@ -1,15 +0,0 @@ -APP_ENV=testing -APP_KEY=base64:NTrXToqFZJlv48dgPc+kNpc3SBt333TfDnF1mDShsBg= -APP_URL=http://localhost:8000 - -DB_CONNECTION=testing -DB_TEST_HOST=mysql -DB_TEST_DATABASE=monica -DB_TEST_USERNAME=root -DB_TEST_PASSWORD= - -CACHE_DRIVER=array -SESSION_DRIVER=file -QUEUE_CONNECTION=sync - -MFA_ENABLED=true diff --git a/scripts/ci/.env.mysql b/scripts/ci/.env.mysql index 9b4d04c4f57..b4ad0f26a2c 100644 --- a/scripts/ci/.env.mysql +++ b/scripts/ci/.env.mysql @@ -1,19 +1,25 @@ +# ENV FILE FOR THE GITHUB ACTION RUNNING MYSQL APP_ENV=testing -APP_KEY=base64:NTrXToqFZJlv48dgPc+kNpc3SBt333TfDnF1mDShsBg= -APP_URL=http://localhost:8000 +APP_KEY= +APP_DEBUG=true +APP_URL=https://monica.test -DB_CONNECTION=testing -DB_TEST_HOST=127.0.0.1 -DB_TEST_DATABASE=monica -DB_TEST_USERNAME=root -DB_TEST_PASSWORD= +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=monica +DB_USERNAME=monica +DB_PASSWORD=secret -MAIL_FROM_ADDRESS= -MAIL_FROM_NAME= -APP_EMAIL_NEW_USERS_NOTIFICATION= +BROADCAST_DRIVER=log +# Values from phpunit.xml +DEBUGBAR_ENABLED=false CACHE_DRIVER=array -SESSION_DRIVER=file QUEUE_CONNECTION=sync -LOG_CHANNEL=testing -BROADCAST_DRIVER=log +SESSION_DRIVER=array +MAIL_MAILER=array + +MAIL_FROM_ADDRESS= +MAIL_FROM_NAME= +APP_EMAIL_NEW_USERS_NOTIFICATION= From 88090282debca410a5dabf6df0014f81498b1512 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 18:44:14 +0100 Subject: [PATCH 02/45] update --- .github/workflows/build.yml | 2 +- .github/workflows/cypress.yml | 2 +- .github/workflows/migration_tests.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/static.yml | 2 ++ .github/workflows/tests.yml | 4 ++-- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bc4079c76b..890b8615c71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring, dom, fileinfo, ${{ matrix.connection }} + extensions: imagick, mbstring, dom, fileinfo, ${{ matrix.connection }} coverage: none - name: Check PHP Version run: php -v diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index bd9e105af76..3ef5e216c2a 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -37,7 +37,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: imagick + extensions: imagick, mbstring, dom, fileinfo coverage: none - name: Check PHP Version run: php -v diff --git a/.github/workflows/migration_tests.yml b/.github/workflows/migration_tests.yml index 72ad4dc0748..6241f5a12f4 100644 --- a/.github/workflows/migration_tests.yml +++ b/.github/workflows/migration_tests.yml @@ -47,7 +47,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring, dom, fileinfo, ${{ matrix.connection }} + extensions: imagick, mbstring, dom, fileinfo, ${{ matrix.connection }} coverage: none - name: Check PHP Version run: php -v diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54412e32eb9..3f31cda9d30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,7 +75,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ env.php-version }} - extensions: mbstring, dom, fileinfo + extensions: imagick, mbstring, dom, fileinfo coverage: none # Composer diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 1cc2bde390e..bbedd43074d 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -23,6 +23,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + extensions: imagick, mbstring, dom, fileinfo coverage: none - name: Get Composer Cache Directory @@ -59,6 +60,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + extensions: imagick, mbstring, dom, fileinfo coverage: none - name: Get Composer Cache Directory diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 03101e928d4..46cf2616dcd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,7 +48,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring, dom, fileinfo, ${{ matrix.connection }} + extensions: imagick, mbstring, dom, fileinfo, ${{ matrix.connection }} coverage: none - name: Check PHP Version run: php -v @@ -153,7 +153,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring, dom, fileinfo, ${{ matrix.connection }} + extensions: imagick, mbstring, dom, fileinfo, ${{ matrix.connection }} coverage: none - name: Check PHP Version run: php -v From d130dea6992c1c98b26d2310c1bb0edf41a3919f Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 19:05:11 +0100 Subject: [PATCH 03/45] add some dumps --- .github/workflows/tests.yml | 2 +- tests/Api/DAV/DAVServerTest.php | 1 + .../Unit/Controllers/Contact/ContactAuditLogControllerTest.php | 1 + tests/Unit/Controllers/Settings/AuditLogControllerTest.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 46cf2616dcd..3b6c308b1e1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: ############# tests: runs-on: ubuntu-latest - name: Test on ${{ matrix.connection }} (PHP ${{ matrix.php-version }}) + name: Test on ${{ matrix.connection }} run ${{ github.run_number }} (PHP ${{ matrix.php-version }}) services: mysql: diff --git a/tests/Api/DAV/DAVServerTest.php b/tests/Api/DAV/DAVServerTest.php index 45cd51f61f5..29634ae3f10 100644 --- a/tests/Api/DAV/DAVServerTest.php +++ b/tests/Api/DAV/DAVServerTest.php @@ -199,6 +199,7 @@ public function test_dav_limit_users_unauthorized() $response = $this->call('PROPFIND', '/dav'); +$response->dump(); $response->assertStatus(403); } diff --git a/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php b/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php index 4359f286272..6158b15baef 100644 --- a/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php +++ b/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php @@ -21,6 +21,7 @@ public function it_gets_the_list_of_audit_logs_for_the_contact() $response = $this->get("/people/{$contact->hashID()}/auditlogs"); +$response->dump(); $response->assertStatus(200); } } diff --git a/tests/Unit/Controllers/Settings/AuditLogControllerTest.php b/tests/Unit/Controllers/Settings/AuditLogControllerTest.php index 7a65e766558..8e419df4932 100644 --- a/tests/Unit/Controllers/Settings/AuditLogControllerTest.php +++ b/tests/Unit/Controllers/Settings/AuditLogControllerTest.php @@ -21,6 +21,7 @@ public function it_gets_the_list_of_audit_logs_for_the_account() $response = $this->get('/settings/auditlogs'); +$response->dump(); $response->assertStatus(200); } } From 96bed331856e9c453472a52f5136289301300dc8 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 18:05:31 +0000 Subject: [PATCH 04/45] Apply fixes from StyleCI --- tests/Api/DAV/DAVServerTest.php | 2 +- .../Unit/Controllers/Contact/ContactAuditLogControllerTest.php | 2 +- tests/Unit/Controllers/Settings/AuditLogControllerTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Api/DAV/DAVServerTest.php b/tests/Api/DAV/DAVServerTest.php index 29634ae3f10..a539b6f63ef 100644 --- a/tests/Api/DAV/DAVServerTest.php +++ b/tests/Api/DAV/DAVServerTest.php @@ -199,7 +199,7 @@ public function test_dav_limit_users_unauthorized() $response = $this->call('PROPFIND', '/dav'); -$response->dump(); + $response->dump(); $response->assertStatus(403); } diff --git a/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php b/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php index 6158b15baef..d6d0b6ad589 100644 --- a/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php +++ b/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php @@ -21,7 +21,7 @@ public function it_gets_the_list_of_audit_logs_for_the_contact() $response = $this->get("/people/{$contact->hashID()}/auditlogs"); -$response->dump(); + $response->dump(); $response->assertStatus(200); } } diff --git a/tests/Unit/Controllers/Settings/AuditLogControllerTest.php b/tests/Unit/Controllers/Settings/AuditLogControllerTest.php index 8e419df4932..4d417e7938b 100644 --- a/tests/Unit/Controllers/Settings/AuditLogControllerTest.php +++ b/tests/Unit/Controllers/Settings/AuditLogControllerTest.php @@ -21,7 +21,7 @@ public function it_gets_the_list_of_audit_logs_for_the_account() $response = $this->get('/settings/auditlogs'); -$response->dump(); + $response->dump(); $response->assertStatus(200); } } From 5121cd56db39b72023121fbd5eb2861b4d0ffa93 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 19:13:43 +0100 Subject: [PATCH 05/45] fix --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b6c308b1e1..83438d0df1a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: ############# tests: runs-on: ubuntu-latest - name: Test on ${{ matrix.connection }} run ${{ github.run_number }} (PHP ${{ matrix.php-version }}) + name: Test on ${{ matrix.connection }} Testsuite ${{ matrix.testsuite }} (PHP ${{ matrix.php-version }}) services: mysql: @@ -82,11 +82,11 @@ jobs: run: | cp scripts/ci/.env.${{ matrix.connection }} .env touch config/.version config/.release .sentry-release .sentry-commit - echo '{"/js/app.js": "/js/app.js", "/css/app.css": "/css/app.css"}' > public/mix-manifest.json + echo '{"/js/app.js": "/js/app.js", "/css/app-ltr.css": "/css/app-ltr.css"}' > public/mix-manifest.json mkdir -p public/js echo '' > public/js/app.js mkdir -p public/css - echo '' > public/css/app.css + echo '' > public/css/app-ltr.css - name: Generate key run: php artisan key:generate @@ -105,7 +105,7 @@ jobs: - name: Run Unit test suite run: | php artisan route:cache - phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --testsuite ${{ matrix.testsuite }} --log-junit ./results/junit/results${{ github.run_number }}.xml --coverage-clover ./results/coverage${{ github.run_number }}.xml + phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --testsuite ${{ matrix.testsuite }} --log-junit ./results/junit/results${{ matrix.testsuite }}.xml --coverage-clover ./results/coverage${{ matrix.testsuite }}.xml env: DB_CONNECTION: ${{ matrix.connection }} @@ -116,7 +116,7 @@ jobs: if: matrix.php-version == '7.4' uses: actions/upload-artifact@v2 with: - name: results${{ github.run_number }} + name: results${{ matrix.testsuite }} path: results From f72eb89adeea6234df7bab7d26cd712ac5f7c7d1 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 19:24:59 +0100 Subject: [PATCH 06/45] fix assets --- .github/workflows/tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83438d0df1a..8837dd1d7cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -82,11 +82,14 @@ jobs: run: | cp scripts/ci/.env.${{ matrix.connection }} .env touch config/.version config/.release .sentry-release .sentry-commit - echo '{"/js/app.js": "/js/app.js", "/css/app-ltr.css": "/css/app-ltr.css"}' > public/mix-manifest.json mkdir -p public/js - echo '' > public/js/app.js mkdir -p public/css - echo '' > public/css/app-ltr.css + echo "{" > public/mix-manifest.json + for f in "js/app.js" "js/manifest.js" "js/vendor.js" "css/app-ltr.css "css/app-rtl.css" "js/stripe.js" "css/stripe.css"; do + echo "\"/$f\": \"/$f\"," >> public/mix-manifest.json + echo '' > public/$f + done + echo "}" >> public/mix-manifest.json - name: Generate key run: php artisan key:generate From 655d6851ec0a4e66275a81e751fe64ba2212fe9e Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 19:33:33 +0100 Subject: [PATCH 07/45] fix --- .github/workflows/tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8837dd1d7cc..d2db71b8e9d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,9 +85,10 @@ jobs: mkdir -p public/js mkdir -p public/css echo "{" > public/mix-manifest.json - for f in "js/app.js" "js/manifest.js" "js/vendor.js" "css/app-ltr.css "css/app-rtl.css" "js/stripe.js" "css/stripe.css"; do - echo "\"/$f\": \"/$f\"," >> public/mix-manifest.json - echo '' > public/$f + for f in app.js manifest.js vendor.js app-ltr.css app-rtl.css stripe.js stripe.css; do + k=${f##*.}/$f + echo "\"/$k\": \"/$k\"," >> public/mix-manifest.json + echo '' > public/$k done echo "}" >> public/mix-manifest.json From 6989d2d2adc4e003eab9766f3268b1a801c23d77 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 19:44:49 +0100 Subject: [PATCH 08/45] add cat --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d2db71b8e9d..a57c779ebe8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -91,6 +91,7 @@ jobs: echo '' > public/$k done echo "}" >> public/mix-manifest.json + cat public/mix-manifest.json - name: Generate key run: php artisan key:generate From 6b93c7a17018858f25a3284fbc77eb44f21f502c Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 19:57:21 +0100 Subject: [PATCH 09/45] fix json --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a57c779ebe8..1b83aa9242e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,6 +86,7 @@ jobs: mkdir -p public/css echo "{" > public/mix-manifest.json for f in app.js manifest.js vendor.js app-ltr.css app-rtl.css stripe.js stripe.css; do + [[ $first == 1 ]] && echo -n "," >> public/mix-manifest.json || first=1 k=${f##*.}/$f echo "\"/$k\": \"/$k\"," >> public/mix-manifest.json echo '' > public/$k From 2ace9a48f20d31428e9902a5897b7aecce4e3a78 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 20:00:23 +0100 Subject: [PATCH 10/45] crap --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1b83aa9242e..ed2b97259a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -88,7 +88,7 @@ jobs: for f in app.js manifest.js vendor.js app-ltr.css app-rtl.css stripe.js stripe.css; do [[ $first == 1 ]] && echo -n "," >> public/mix-manifest.json || first=1 k=${f##*.}/$f - echo "\"/$k\": \"/$k\"," >> public/mix-manifest.json + echo "\"/$k\": \"/$k\"" >> public/mix-manifest.json echo '' > public/$k done echo "}" >> public/mix-manifest.json From cb035a7008ed197bc67add10907ce560138a08d4 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 20:08:45 +0100 Subject: [PATCH 11/45] change app_url --- .github/workflows/build.yml | 2 +- scripts/ci/.env.mysql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 890b8615c71..ccf049a7c7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build and test +name: Build on: push: diff --git a/scripts/ci/.env.mysql b/scripts/ci/.env.mysql index b4ad0f26a2c..1ca01228d15 100644 --- a/scripts/ci/.env.mysql +++ b/scripts/ci/.env.mysql @@ -2,7 +2,7 @@ APP_ENV=testing APP_KEY= APP_DEBUG=true -APP_URL=https://monica.test +APP_URL=http://localhost:8000 DB_CONNECTION=mysql DB_HOST=127.0.0.1 From 245131a76da8cfd8fc1892ff5c2881f43b5718e6 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 20:24:23 +0100 Subject: [PATCH 12/45] back --- .github/workflows/tests.yml | 6 +++++- tests/Api/DAV/DAVServerTest.php | 1 - .../Controllers/Contact/ContactAuditLogControllerTest.php | 1 - tests/Unit/Controllers/Settings/AuditLogControllerTest.php | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ed2b97259a5..c2b3aebe764 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -82,6 +82,7 @@ jobs: run: | cp scripts/ci/.env.${{ matrix.connection }} .env touch config/.version config/.release .sentry-release .sentry-commit + mkdir -p results/coverage mkdir -p public/js mkdir -p public/css echo "{" > public/mix-manifest.json @@ -119,7 +120,7 @@ jobs: run: sed -i -e "s%$GITHUB_WORKSPACE/%%g" results/*/*.xml - name: Store results - if: matrix.php-version == '7.4' + if: matrix.php-version == '7.4' && always() uses: actions/upload-artifact@v2 with: name: results${{ matrix.testsuite }} @@ -211,6 +212,8 @@ jobs: run: | cp scripts/ci/.env.${{ matrix.connection }} .env touch config/.version config/.release .sentry-release .sentry-commit + mkdir -p results/coverage + mkdir -p results/console - name: Generate key run: php artisan key:generate @@ -250,6 +253,7 @@ jobs: rm -rf results/coverage - name: Store results + if: always() uses: actions/upload-artifact@v2 with: name: results0 diff --git a/tests/Api/DAV/DAVServerTest.php b/tests/Api/DAV/DAVServerTest.php index a539b6f63ef..45cd51f61f5 100644 --- a/tests/Api/DAV/DAVServerTest.php +++ b/tests/Api/DAV/DAVServerTest.php @@ -199,7 +199,6 @@ public function test_dav_limit_users_unauthorized() $response = $this->call('PROPFIND', '/dav'); - $response->dump(); $response->assertStatus(403); } diff --git a/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php b/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php index d6d0b6ad589..4359f286272 100644 --- a/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php +++ b/tests/Unit/Controllers/Contact/ContactAuditLogControllerTest.php @@ -21,7 +21,6 @@ public function it_gets_the_list_of_audit_logs_for_the_contact() $response = $this->get("/people/{$contact->hashID()}/auditlogs"); - $response->dump(); $response->assertStatus(200); } } diff --git a/tests/Unit/Controllers/Settings/AuditLogControllerTest.php b/tests/Unit/Controllers/Settings/AuditLogControllerTest.php index 4d417e7938b..7a65e766558 100644 --- a/tests/Unit/Controllers/Settings/AuditLogControllerTest.php +++ b/tests/Unit/Controllers/Settings/AuditLogControllerTest.php @@ -21,7 +21,6 @@ public function it_gets_the_list_of_audit_logs_for_the_account() $response = $this->get('/settings/auditlogs'); - $response->dump(); $response->assertStatus(200); } } From 3769186f546d7b13cbd33ba2cb61a58ef675dc5f Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 21:49:21 +0100 Subject: [PATCH 13/45] fix --- .github/workflows/tests.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2b3aebe764..b764aef7b11 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -231,12 +231,8 @@ jobs: # Test - name: Launch google chrome run: | - echo "##vso[task.setvariable variable=DISPLAY]$DISPLAY" - Xvfb ${DISPLAY} -screen 0 1920x1080x24 & php artisan dusk:chrome-driver $(google-chrome -version | awk '{ print $3 }' | cut -d . -f 1) ./vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 & - env: - DISPLAY: ':99' - name: Run http server run: | @@ -244,9 +240,24 @@ jobs: php -S localhost:8001 -t public scripts/tests/server-cc.php & - name: Run browser tests - run: php artisan dusk --log-junit results/junit/results0.xml + run: | + chmod -R 0755 vendor/laravel/dusk/bin/ + php artisan dusk --log-junit results/junit/results0.xml env: - CHROME_DRIVER_OPTS: --headless --disable-gpu --disable-dev-shm-usage --no-sandbox --remote-debugging-port=9222 --window-size=1920,1080 + APP_URL: "http://127.0.0.1:8000" + - name: Upload Screenshots + if: failure() + uses: actions/upload-artifact@v2 + with: + name: screenshots + path: tests/Browser/screenshots + - name: Upload Console Logs + if: failure() + uses: actions/upload-artifact@v2 + with: + name: console + path: tests/Browser/console + - name: Fix coverage run: | vendor/bin/phpcov merge --clover=results/coverage0.xml results/coverage/ From 291332d07919789e32304adb377b7919c6f5536f Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sun, 21 Feb 2021 22:06:32 +0100 Subject: [PATCH 14/45] fix dusk --- .github/workflows/tests.yml | 12 ----------- tests/DuskTestCase.php | 40 +++++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b764aef7b11..acebaa1a8a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -245,18 +245,6 @@ jobs: php artisan dusk --log-junit results/junit/results0.xml env: APP_URL: "http://127.0.0.1:8000" - - name: Upload Screenshots - if: failure() - uses: actions/upload-artifact@v2 - with: - name: screenshots - path: tests/Browser/screenshots - - name: Upload Console Logs - if: failure() - uses: actions/upload-artifact@v2 - with: - name: console - path: tests/Browser/console - name: Fix coverage run: | diff --git a/tests/DuskTestCase.php b/tests/DuskTestCase.php index 23479d63f30..aa2c042180d 100644 --- a/tests/DuskTestCase.php +++ b/tests/DuskTestCase.php @@ -32,7 +32,7 @@ protected function setUp(): void */ public static function prepare() { - if (env('SAUCELABS') != '1') { + if (! static::runningInSail()) { static::startChromeDriver(); } } @@ -44,22 +44,32 @@ public static function prepare() */ protected function driver() { - $options = (new ChromeOptions)->addArguments(explode(' ', env('CHROME_DRIVER_OPTS', ''))); - $capabilities = DesiredCapabilities::chrome()->setCapability( - ChromeOptions::CAPABILITY, $options + $options = (new ChromeOptions)->addArguments(collect([ + '--window-size=1920,1080', + ])->unless($this->hasHeadlessDisabled(), function ($items) { + return $items->merge([ + '--disable-gpu', + '--headless', + ]); + })->all()); + + return RemoteWebDriver::create( + $_ENV['DUSK_DRIVER_URL'] ?? 'http://localhost:9515', + DesiredCapabilities::chrome()->setCapability( + ChromeOptions::CAPABILITY, $options + ) ); + } - if (env('SAUCELABS') == '1') { - $capabilities->setCapability('tunnel-identifier', env('TRAVIS_JOB_NUMBER')); - - return RemoteWebDriver::create( - 'http://'.env('SAUCE_USERNAME').':'.env('SAUCE_ACCESS_KEY').'@localhost:4445/wd/hub', $capabilities - ); - } else { - return RemoteWebDriver::create( - 'http://localhost:9515', $capabilities - ); - } + /** + * Determine whether the Dusk command has disabled headless mode. + * + * @return bool + */ + protected function hasHeadlessDisabled() + { + return isset($_SERVER['DUSK_HEADLESS_DISABLED']) || + isset($_ENV['DUSK_HEADLESS_DISABLED']); } /** From 432629b7c42ad85726c1cf0d15b168b285eba7f3 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 19:23:46 +0100 Subject: [PATCH 15/45] fix --- .github/workflows/cypress.yml | 2 +- .github/workflows/tests.yml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 3ef5e216c2a..47363fc9b6a 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -96,7 +96,7 @@ jobs: run: php artisan key:generate - name: Prepare db - run: mysql -h 127.0.0.1 -u monica -psecret -P 3306 monica < scripts/database.test.sql + run: mysql -h 127.0.0.1 -P 3306 -u monica -psecret monica < scripts/database.test.sql - name: Run migration scripts run: php artisan migrate --no-interaction -vvv diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index acebaa1a8a8..7f5961b6795 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -99,7 +99,7 @@ jobs: run: php artisan key:generate - name: Prepare db - run: mysql -h 127.0.0.1 -u monica -psecret -P 3306 monica < scripts/database.test.sql + run: mysql -h 127.0.0.1 -P 3306 -u monica -psecret monica < scripts/database.test.sql - name: Run migrations run: php artisan migrate --no-interaction -vvv @@ -219,7 +219,7 @@ jobs: run: php artisan key:generate - name: Prepare db - run: mysql -h 127.0.0.1 -u monica -psecret -P 3306 monica < scripts/database.test.sql + run: mysql -h 127.0.0.1 -P 3306 -u monica -psecret monica < scripts/database.test.sql - name: Run migrations run: php artisan migrate --no-interaction -vvv @@ -229,10 +229,12 @@ jobs: run: php artisan passport:keys --no-interaction -vvv # Test - - name: Launch google chrome + - name: Upgrade Chrome Driver + run: php artisan dusk:chrome-driver $(google-chrome -version | awk '{ print $3 }' | cut -d . -f 1) + - name: Start Chrome Driver run: | - php artisan dusk:chrome-driver $(google-chrome -version | awk '{ print $3 }' | cut -d . -f 1) - ./vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 & + chmod -R 0755 vendor/laravel/dusk/bin/ + ./vendor/laravel/dusk/bin/chromedriver-linux & - name: Run http server run: | @@ -240,11 +242,9 @@ jobs: php -S localhost:8001 -t public scripts/tests/server-cc.php & - name: Run browser tests - run: | - chmod -R 0755 vendor/laravel/dusk/bin/ - php artisan dusk --log-junit results/junit/results0.xml + run: php artisan dusk --log-junit results/junit/results0.xml env: - APP_URL: "http://127.0.0.1:8000" + APP_URL: http://127.0.0.1:8000 - name: Fix coverage run: | From 0ae58580af899c44e20d8ebb865fb1970b1d4c51 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 19:32:12 +0100 Subject: [PATCH 16/45] use localhost --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f5961b6795..92b41a993ac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -244,7 +244,7 @@ jobs: - name: Run browser tests run: php artisan dusk --log-junit results/junit/results0.xml env: - APP_URL: http://127.0.0.1:8000 + APP_URL: http://localhost:8000 - name: Fix coverage run: | From 6bd26de2dd14bdca24b4c7a0171b64cc72ee2d84 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 19:40:40 +0100 Subject: [PATCH 17/45] add logs --- .github/workflows/tests.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 92b41a993ac..63a76ea004a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -240,6 +240,8 @@ jobs: run: | php -S localhost:8000 -t public scripts/tests/server-cc.php & php -S localhost:8001 -t public scripts/tests/server-cc.php & + env: + LOG_CHANNEL: single - name: Run browser tests run: php artisan dusk --log-junit results/junit/results0.xml @@ -258,6 +260,13 @@ jobs: name: results0 path: results + - name: Store logs + if: always() + uses: actions/upload-artifact@v2 + with: + name: logs + path: storage/logs + ########################### # Reporting to sonarcloud From 27b6e65323d134cc41f356609b4fa491e611700b Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 19:47:38 +0100 Subject: [PATCH 18/45] add test --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 63a76ea004a..d826479cbc1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -211,6 +211,7 @@ jobs: - name: Prepare environment run: | cp scripts/ci/.env.${{ matrix.connection }} .env + echo -e "\nLOG_CHANNEL=single" >> .env touch config/.version config/.release .sentry-release .sentry-commit mkdir -p results/coverage mkdir -p results/console @@ -240,8 +241,10 @@ jobs: run: | php -S localhost:8000 -t public scripts/tests/server-cc.php & php -S localhost:8001 -t public scripts/tests/server-cc.php & - env: - LOG_CHANNEL: single + + - name: Test http server + run: | + curl http://localhost:8000 - name: Run browser tests run: php artisan dusk --log-junit results/junit/results0.xml From e0c24f6213ffa5359d0d4309d6f304ae4b05380e Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 20:10:01 +0100 Subject: [PATCH 19/45] add verbose --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d826479cbc1..ea8e9aaae51 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -243,8 +243,7 @@ jobs: php -S localhost:8001 -t public scripts/tests/server-cc.php & - name: Test http server - run: | - curl http://localhost:8000 + run: curl -v http://localhost:8000 - name: Run browser tests run: php artisan dusk --log-junit results/junit/results0.xml From 1c8de36cb53434f22b224d672e122394c4588dc4 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 20:52:42 +0100 Subject: [PATCH 20/45] fix rights --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea8e9aaae51..502464b0a33 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -215,6 +215,7 @@ jobs: touch config/.version config/.release .sentry-release .sentry-commit mkdir -p results/coverage mkdir -p results/console + chmod -R 777 storage bootstrap/cache - name: Generate key run: php artisan key:generate From c9ea8cc3ced217844538145c497a7be33c8167be Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 22:49:41 +0100 Subject: [PATCH 21/45] set node version --- .github/workflows/build.yml | 7 ++++++ .github/workflows/cypress.yml | 7 ++++++ .github/workflows/release.yml | 5 +++++ .github/workflows/tests.yml | 7 ++++++ phpunit.xml | 40 ++++++++++++++++++++--------------- 5 files changed, 49 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccf049a7c7c..7e5ef767c84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,9 @@ jobs: matrix: php-version: [7.4] + env: + node-version: 14.x + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -64,6 +67,10 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 47363fc9b6a..a1074ff043a 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -29,6 +29,9 @@ jobs: browser: [chrome] containers: [1, 2, 3, 4, 5, 6, 7, 8] + env: + node-version: 14.x + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -67,6 +70,10 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f31cda9d30..00a291ecdb0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,6 +60,7 @@ jobs: env: php-version: 7.4 + node-version: 14.x steps: - name: Checkout repository @@ -93,6 +94,10 @@ jobs: ${{ runner.os }}-composer- # Yarn + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 502464b0a33..440eb429a86 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -152,6 +152,9 @@ jobs: php-version: [7.4] connection: [mysql] + env: + node-version: 14.x + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -190,6 +193,10 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/phpunit.xml b/phpunit.xml index 34a6cd7f434..ec27e7c3eda 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -43,23 +43,29 @@ + + + ./app + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + From 97c5b614df68bfea265e2a701934e0a2d0f52173 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 23:17:33 +0100 Subject: [PATCH 22/45] fix workflow --- .github/workflows/build.yml | 5 +---- .github/workflows/cypress.yml | 5 +---- .github/workflows/tests.yml | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e5ef767c84..af448ee6fbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,9 +26,6 @@ jobs: matrix: php-version: [7.4] - env: - node-version: 14.x - steps: - name: Checkout sources uses: actions/checkout@v2 @@ -70,7 +67,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: ${{ env.node-version }} + node-version: 14.x - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index a1074ff043a..a7b7de6778e 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -29,9 +29,6 @@ jobs: browser: [chrome] containers: [1, 2, 3, 4, 5, 6, 7, 8] - env: - node-version: 14.x - steps: - name: Checkout sources uses: actions/checkout@v2 @@ -73,7 +70,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: ${{ env.node-version }} + node-version: 14.x - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 440eb429a86..16fde343d58 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -152,9 +152,6 @@ jobs: php-version: [7.4] connection: [mysql] - env: - node-version: 14.x - steps: - name: Checkout sources uses: actions/checkout@v2 @@ -196,7 +193,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: ${{ env.node-version }} + node-version: 14.x - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" From 64f3cb383aadf71bc5e6fd270dbb63f85217bbe9 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 23:22:19 +0100 Subject: [PATCH 23/45] fix node install --- .github/workflows/build.yml | 7 +++++-- .github/workflows/cypress.yml | 7 +++++-- .github/workflows/tests.yml | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af448ee6fbb..cc6c89b0226 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,9 @@ jobs: matrix: php-version: [7.4] + env: + node-version: 14 + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -65,9 +68,9 @@ jobs: # Yarn - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 14.x + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index a7b7de6778e..0060d7b8008 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -29,6 +29,9 @@ jobs: browser: [chrome] containers: [1, 2, 3, 4, 5, 6, 7, 8] + env: + node-version: 14 + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -68,9 +71,9 @@ jobs: # Yarn - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 14.x + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 16fde343d58..4a24c5f54b7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -152,6 +152,9 @@ jobs: php-version: [7.4] connection: [mysql] + env: + node-version: 14 + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -191,9 +194,9 @@ jobs: # Yarn - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 14.x + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" From d5e05685d07401b4ab66d09763904b8e795757a4 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 23:29:55 +0100 Subject: [PATCH 24/45] fix node.js --- .github/workflows/build.yml | 5 +---- .github/workflows/cypress.yml | 5 +---- .github/workflows/tests.yml | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc6c89b0226..e9122347b71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,9 +26,6 @@ jobs: matrix: php-version: [7.4] - env: - node-version: 14 - steps: - name: Checkout sources uses: actions/checkout@v2 @@ -70,7 +67,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v2 with: - node-version: ${{ env.node-version }} + node-version: 14 - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 0060d7b8008..157d2ee633b 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -29,9 +29,6 @@ jobs: browser: [chrome] containers: [1, 2, 3, 4, 5, 6, 7, 8] - env: - node-version: 14 - steps: - name: Checkout sources uses: actions/checkout@v2 @@ -73,7 +70,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v2 with: - node-version: ${{ env.node-version }} + node-version: 14 - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4a24c5f54b7..f0c99de3f4c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -152,9 +152,6 @@ jobs: php-version: [7.4] connection: [mysql] - env: - node-version: 14 - steps: - name: Checkout sources uses: actions/checkout@v2 @@ -196,7 +193,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v2 with: - node-version: ${{ env.node-version }} + node-version: 14 - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" From 65f841903326ded6c205c73fea8148d39f75fd79 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 22 Feb 2021 23:38:36 +0100 Subject: [PATCH 25/45] remove node install --- .github/workflows/build.yml | 4 ---- .github/workflows/cypress.yml | 4 ---- .github/workflows/tests.yml | 4 ---- 3 files changed, 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9122347b71..ccf049a7c7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,10 +64,6 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 14 - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 157d2ee633b..47363fc9b6a 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -67,10 +67,6 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 14 - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f0c99de3f4c..502464b0a33 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -190,10 +190,6 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 14 - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" From d095fe8b5b1d7841f7af9751467ad8249e774574 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Tue, 23 Feb 2021 08:31:46 +0100 Subject: [PATCH 26/45] x --- .github/workflows/release.yml | 8 ++++---- phpunit.xml | 6 ------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00a291ecdb0..bd7187a4dc0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: env: php-version: 7.4 - node-version: 14.x + node-version: 14 steps: - name: Checkout repository @@ -95,9 +95,9 @@ jobs: # Yarn - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: ${{ env.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/phpunit.xml b/phpunit.xml index ec27e7c3eda..40848185cd2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -43,12 +43,6 @@ - - - ./app - - - From 9888490e168edd659c18f2816edae188fdbb4925 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Tue, 23 Feb 2021 10:47:43 +0100 Subject: [PATCH 27/45] re-add node-version and debug --- .github/workflows/build.yml | 7 +++++++ .github/workflows/cypress.yml | 7 +++++++ .github/workflows/tests.yml | 15 +++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccf049a7c7c..533f72f2e2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,9 @@ jobs: matrix: php-version: [7.4] + env: + node-version: 14 + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -64,6 +67,10 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 47363fc9b6a..baccba8d2fb 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -29,6 +29,9 @@ jobs: browser: [chrome] containers: [1, 2, 3, 4, 5, 6, 7, 8] + env: + node-version: 14 + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -67,6 +70,10 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 502464b0a33..ae7eabdb83b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -152,6 +152,9 @@ jobs: php-version: [7.4] connection: [mysql] + env: + node-version: 14 + steps: - name: Checkout sources uses: actions/checkout@v2 @@ -190,6 +193,10 @@ jobs: run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-req=php # Yarn + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.node-version }} - name: Get yarn cache directory path id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" @@ -256,6 +263,14 @@ jobs: vendor/bin/phpcov merge --clover=results/coverage0.xml results/coverage/ rm -rf results/coverage + - name: debug + if: always() + run: find results + + - name: debug + if: always() + run: find storage + - name: Store results if: always() uses: actions/upload-artifact@v2 From 0447d2ef9100da32baceef1e497ecb162020501f Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Tue, 23 Feb 2021 12:05:07 +0100 Subject: [PATCH 28/45] I --- .github/workflows/cypress.yml | 2 +- .github/workflows/tests.yml | 2 +- config/database.php | 2 +- phpunit.xml | 34 +++++++++++++++++----------------- scripts/ci/.env.mysql | 1 + 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index baccba8d2fb..7ca55413978 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -54,7 +54,7 @@ jobs: run: composer validate - name: Get Composer Cache Directory - id: composer-cache-dir-path + id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer files uses: actions/cache@v2.1.4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ae7eabdb83b..9d43ab4273b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Tests and report +name: Unit tests on: push: diff --git a/config/database.php b/config/database.php index c6e36913221..a9a3d7bf2c1 100644 --- a/config/database.php +++ b/config/database.php @@ -97,7 +97,7 @@ ], 'testing' => [ - 'driver' => 'mysql', + 'driver' => env('DB_TEST_DRIVER', 'mysql'), 'host' => env('DB_TEST_HOST'), 'unix_socket' => env('DB_TEST_UNIX_SOCKET', ''), 'database' => env('DB_TEST_DATABASE'), diff --git a/phpunit.xml b/phpunit.xml index 40848185cd2..34a6cd7f434 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -44,22 +44,22 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/scripts/ci/.env.mysql b/scripts/ci/.env.mysql index 1ca01228d15..36e58b29bb0 100644 --- a/scripts/ci/.env.mysql +++ b/scripts/ci/.env.mysql @@ -10,6 +10,7 @@ DB_PORT=3306 DB_DATABASE=monica DB_USERNAME=monica DB_PASSWORD=secret +DB_USE_UTF8MB4=true BROADCAST_DRIVER=log From 49bda4d4d409299859682231f92169a0c5d3c366 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Tue, 23 Feb 2021 20:04:15 +0100 Subject: [PATCH 29/45] don't --- .github/workflows/tests.yml | 1 - scripts/ci/.env.mysql | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9d43ab4273b..db102b44c20 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -218,7 +218,6 @@ jobs: - name: Prepare environment run: | cp scripts/ci/.env.${{ matrix.connection }} .env - echo -e "\nLOG_CHANNEL=single" >> .env touch config/.version config/.release .sentry-release .sentry-commit mkdir -p results/coverage mkdir -p results/console diff --git a/scripts/ci/.env.mysql b/scripts/ci/.env.mysql index 36e58b29bb0..85acaea232d 100644 --- a/scripts/ci/.env.mysql +++ b/scripts/ci/.env.mysql @@ -13,6 +13,7 @@ DB_PASSWORD=secret DB_USE_UTF8MB4=true BROADCAST_DRIVER=log +LOG_CHANNEL=testing # Values from phpunit.xml DEBUGBAR_ENABLED=false From 7264bbc00744c5468d8318f0745a862b8fba8306 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Tue, 23 Feb 2021 22:30:49 +0100 Subject: [PATCH 30/45] know --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index db102b44c20..14492ed63ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -246,8 +246,11 @@ jobs: - name: Run http server run: | - php -S localhost:8000 -t public scripts/tests/server-cc.php & - php -S localhost:8001 -t public scripts/tests/server-cc.php & + php artisan server --port=8000 & + php artisan server --port=8001 & +# run: | +# php -S localhost:8000 -t public scripts/tests/server-cc.php & +# php -S localhost:8001 -t public scripts/tests/server-cc.php & - name: Test http server run: curl -v http://localhost:8000 From 98660fa3a120fa732fd04744b8202397331551d3 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Tue, 23 Feb 2021 23:16:38 +0100 Subject: [PATCH 31/45] what --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 14492ed63ca..2ad17225b0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -246,8 +246,8 @@ jobs: - name: Run http server run: | - php artisan server --port=8000 & - php artisan server --port=8001 & + php artisan serve --port=8000 & + php artisan serve --port=8001 & # run: | # php -S localhost:8000 -t public scripts/tests/server-cc.php & # php -S localhost:8001 -t public scripts/tests/server-cc.php & From 7cf35522b6da5bc104b17c6b7d298cf30af4afb6 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Wed, 24 Feb 2021 08:26:01 +0100 Subject: [PATCH 32/45] the --- scripts/ci/.env.mysql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ci/.env.mysql b/scripts/ci/.env.mysql index 85acaea232d..5d7424dd2c6 100644 --- a/scripts/ci/.env.mysql +++ b/scripts/ci/.env.mysql @@ -1,6 +1,6 @@ # ENV FILE FOR THE GITHUB ACTION RUNNING MYSQL APP_ENV=testing -APP_KEY= +APP_KEY=base64:NTrXToqFZJlv48dgPc+kNpc3SBt333TfDnF1mDShsBg= APP_DEBUG=true APP_URL=http://localhost:8000 @@ -13,7 +13,7 @@ DB_PASSWORD=secret DB_USE_UTF8MB4=true BROADCAST_DRIVER=log -LOG_CHANNEL=testing +LOG_CHANNEL=single # Values from phpunit.xml DEBUGBAR_ENABLED=false From 65781b043d49953e64ec69615784fc4c9969fedb Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Wed, 24 Feb 2021 22:14:04 +0100 Subject: [PATCH 33/45] hell --- .github/workflows/tests.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ad17225b0c..304c5c15be3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -164,7 +164,7 @@ jobs: with: php-version: ${{ matrix.php-version }} extensions: imagick, mbstring, dom, fileinfo, ${{ matrix.connection }} - coverage: none +# coverage: none - name: Check PHP Version run: php -v - name: Check Composer Version @@ -245,16 +245,19 @@ jobs: ./vendor/laravel/dusk/bin/chromedriver-linux & - name: Run http server - run: | - php artisan serve --port=8000 & - php artisan serve --port=8001 & # run: | -# php -S localhost:8000 -t public scripts/tests/server-cc.php & -# php -S localhost:8001 -t public scripts/tests/server-cc.php & +# php artisan serve --port=8000 & +# php artisan serve --port=8001 & + run: | + php -S localhost:8000 -t public scripts/tests/server-cc.php & + php -S localhost:8001 -t public scripts/tests/server-cc.php & - name: Test http server run: curl -v http://localhost:8000 + - name: Test server script + run: php scripts/tests/server-cc.php + - name: Run browser tests run: php artisan dusk --log-junit results/junit/results0.xml env: From 03e49c67203421c3705263f4f97ae36b16575fba Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Wed, 24 Feb 2021 22:26:55 +0100 Subject: [PATCH 34/45] is --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 304c5c15be3..4f0cfce73a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -256,7 +256,7 @@ jobs: run: curl -v http://localhost:8000 - name: Test server script - run: php scripts/tests/server-cc.php + run: REQUEST_URI=/ php scripts/tests/server-cc.php - name: Run browser tests run: php artisan dusk --log-junit results/junit/results0.xml From 6dbed53cad8a9e92504eb1239592a570dabbc6b8 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Thu, 25 Feb 2021 22:42:18 +0100 Subject: [PATCH 35/45] going --- .github/workflows/tests.yml | 6 +----- scripts/ci/.env.mysql | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4f0cfce73a5..141ef21d5c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -163,8 +163,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: imagick, mbstring, dom, fileinfo, ${{ matrix.connection }} -# coverage: none + extensions: imagick, ${{ matrix.connection }} - name: Check PHP Version run: php -v - name: Check Composer Version @@ -245,9 +244,6 @@ jobs: ./vendor/laravel/dusk/bin/chromedriver-linux & - name: Run http server -# run: | -# php artisan serve --port=8000 & -# php artisan serve --port=8001 & run: | php -S localhost:8000 -t public scripts/tests/server-cc.php & php -S localhost:8001 -t public scripts/tests/server-cc.php & diff --git a/scripts/ci/.env.mysql b/scripts/ci/.env.mysql index 5d7424dd2c6..5cdcfa3744b 100644 --- a/scripts/ci/.env.mysql +++ b/scripts/ci/.env.mysql @@ -13,13 +13,13 @@ DB_PASSWORD=secret DB_USE_UTF8MB4=true BROADCAST_DRIVER=log -LOG_CHANNEL=single +LOG_CHANNEL=testing # Values from phpunit.xml DEBUGBAR_ENABLED=false CACHE_DRIVER=array QUEUE_CONNECTION=sync -SESSION_DRIVER=array +SESSION_DRIVER=file MAIL_MAILER=array MAIL_FROM_ADDRESS= From 4e7bae4b5c692ec166379f5386771481008a8cb4 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Thu, 25 Feb 2021 23:03:19 +0100 Subject: [PATCH 36/45] on --- .github/workflows/tests.yml | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 141ef21d5c8..3acd1eb965c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: ############# tests: runs-on: ubuntu-latest - name: Test on ${{ matrix.connection }} Testsuite ${{ matrix.testsuite }} (PHP ${{ matrix.php-version }}) + name: Unit tests on ${{ matrix.connection }} Testsuite ${{ matrix.testsuite }} (PHP ${{ matrix.php-version }}) services: mysql: @@ -132,7 +132,7 @@ jobs: ################### tests_browser: runs-on: ubuntu-latest - name: Test browser on ${{ matrix.connection }} (PHP ${{ matrix.php-version }}) + name: Tests browser on ${{ matrix.connection }} (PHP ${{ matrix.php-version }}) services: mysql: @@ -248,12 +248,6 @@ jobs: php -S localhost:8000 -t public scripts/tests/server-cc.php & php -S localhost:8001 -t public scripts/tests/server-cc.php & - - name: Test http server - run: curl -v http://localhost:8000 - - - name: Test server script - run: REQUEST_URI=/ php scripts/tests/server-cc.php - - name: Run browser tests run: php artisan dusk --log-junit results/junit/results0.xml env: @@ -264,14 +258,6 @@ jobs: vendor/bin/phpcov merge --clover=results/coverage0.xml results/coverage/ rm -rf results/coverage - - name: debug - if: always() - run: find results - - - name: debug - if: always() - run: find storage - - name: Store results if: always() uses: actions/upload-artifact@v2 @@ -279,13 +265,6 @@ jobs: name: results0 path: results - - name: Store logs - if: always() - uses: actions/upload-artifact@v2 - with: - name: logs - path: storage/logs - ########################### # Reporting to sonarcloud From 562b066408dbf341d6d8fc59cf24602a0c1f98ae Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Thu, 25 Feb 2021 23:16:50 +0100 Subject: [PATCH 37/45] with --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 19e6676f567..ef3e1295c7d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.projectKey=monica # this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1. sonar.projectName=monica #sonar.projectVersion= -#sonar.organization=monicahq +sonar.organization=monicahq #sonar.host.url=https://sonarcloud.io # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. @@ -17,6 +17,6 @@ sonar.sourceEncoding=UTF-8 # Links for sonarcloud.io page sonar.links.homepage=https://monicahq.com -sonar.links.ci=https://dev.azure.com/monicahq/monica +sonar.links.ci=https://github.com/monicahq/monica/actions sonar.links.scm=https://github.com/monicahq/monica sonar.links.issue=https://github.com/monicahq/monica/issues From 748484818b77232e6ced36cf7a163a0c5ad69374 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Thu, 25 Feb 2021 23:56:07 +0100 Subject: [PATCH 38/45] these --- .azure/azure.sig | 16 -- .azure/job-analyzers.yml | 20 --- .azure/job-build.yml | 24 --- .azure/job-reporting.yml | 24 --- .azure/job-test-browser.yml | 20 --- .azure/job-test-migrations.yml | 10 -- .azure/job-tests.yml | 18 --- .azure/sign.sh | 8 - .azure/step-cache-composer.yml | 8 - .azure/step-cache-sonar.yml | 17 --- .azure/step-cache-yarn.yml | 8 - .azure/step-composer-install.yml | 18 --- .azure/step-prepare-db.yml | 19 --- .azure/step-prepare-environment.yml | 17 --- .azure/step-publish-results.yml | 16 -- .azure/step-remove-xdebug.yml | 3 - .azure/step-runsonar.yml | 17 --- .azure/step-seed-test-db.yml | 5 - .azure/step-test-browser.yml | 19 --- .azure/step-test-unit.yml | 18 --- azure-pipelines.yml | 39 ----- scripts/ci/.deploy.json.in | 31 ---- scripts/ci/fixsecrets.sh | 30 ---- scripts/ci/rebase.sh | 20 --- scripts/tests/runsonar.sh | 221 ---------------------------- scripts/tests/runsonar.sh.sig | 16 -- sonar-project.properties | 9 +- 27 files changed, 4 insertions(+), 667 deletions(-) delete mode 100644 .azure/azure.sig delete mode 100644 .azure/job-analyzers.yml delete mode 100644 .azure/job-build.yml delete mode 100644 .azure/job-reporting.yml delete mode 100644 .azure/job-test-browser.yml delete mode 100644 .azure/job-test-migrations.yml delete mode 100644 .azure/job-tests.yml delete mode 100755 .azure/sign.sh delete mode 100644 .azure/step-cache-composer.yml delete mode 100644 .azure/step-cache-sonar.yml delete mode 100644 .azure/step-cache-yarn.yml delete mode 100644 .azure/step-composer-install.yml delete mode 100644 .azure/step-prepare-db.yml delete mode 100644 .azure/step-prepare-environment.yml delete mode 100644 .azure/step-publish-results.yml delete mode 100644 .azure/step-remove-xdebug.yml delete mode 100644 .azure/step-runsonar.yml delete mode 100644 .azure/step-seed-test-db.yml delete mode 100644 .azure/step-test-browser.yml delete mode 100644 .azure/step-test-unit.yml delete mode 100644 azure-pipelines.yml delete mode 100644 scripts/ci/.deploy.json.in delete mode 100755 scripts/ci/fixsecrets.sh delete mode 100755 scripts/ci/rebase.sh delete mode 100755 scripts/tests/runsonar.sh delete mode 100644 scripts/tests/runsonar.sh.sig diff --git a/.azure/azure.sig b/.azure/azure.sig deleted file mode 100644 index 5c80cc42370..00000000000 --- a/.azure/azure.sig +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEEuNgCced4O/05ANeg4OezJU6ORAcFAmAb4BcACgkQ4OezJU6O -RAe/Vg/9Gb60hFnTkJZrjjVOcpssiPSbFwAdsv7BMS6ED1ifksVdg/TVAqZoJR1r -Ys/ZJfUBNqo1rKPdqtgyDyJLjFBXVcG2TKAIeGWivg/nybZAwSXuAKELXqOC608p -VDSGT/yuIufPXbrNva9o4zkZ0ASV47FarWaO3c5SQIZDlLwzkm/exPhHLZWiQdc0 -Clbwx13KjWC2cFrcxnwU1m83meXwp7m+swvt86ojrO1q+LcjFitzqMJcmsf5k3dK -8sBjGzHSUTbrJnnYoqnJi5OIFBjLZYcmKT3ZWJAbD//iRwyzE7saJDs3/p8IBQFd -wcfvULZdiMf+a76Vu0TpisN6gn8iTornONtMM7ZspIMP88SuYr16sokKg0OV/I8A -A9aHxRp7rhic2rTCVEsjDQ+A2gZMqW097o4rJp/QSdudsrPsCIXWo1MP3ZsNxaFj -+rWHBDXobbfWMzv6PJJAcj4b6886AfEj5c3/spfNYku46ZYMx4Hhj6CQ2IHEv8zM -9NOCfsIzUkvc9xNOGDTLNDDvjsM1j17YO+7cIYNMoRg2ivRAZ2AGSfJhT5QtUYDz -PlERcki7d4QIu/3VVJpCTj5W88rE7UuFqJo/Cvmi2P0h/iCEDwElM7AmAVFjcMTF -yoKKSBM7MQ3MLEXvSenB2cuMhttyIxfX1wq6cHru1TyxR/MhITY= -=mxjv ------END PGP SIGNATURE----- diff --git a/.azure/job-analyzers.yml b/.azure/job-analyzers.yml deleted file mode 100644 index 01dba88a933..00000000000 --- a/.azure/job-analyzers.yml +++ /dev/null @@ -1,20 +0,0 @@ -jobs: - - job: psalm - pool: - vmImage: 'ubuntu-latest' - steps: - - template: step-prepare-environment.yml - - template: step-composer-install.yml - - - script: vendor/bin/psalm - displayName: Run psalm - - - job: phpstan - pool: - vmImage: 'ubuntu-latest' - steps: - - template: step-prepare-environment.yml - - template: step-composer-install.yml - - - script: vendor/bin/phpstan analyse - displayName: Run phpstan diff --git a/.azure/job-build.yml b/.azure/job-build.yml deleted file mode 100644 index ab9865a3b34..00000000000 --- a/.azure/job-build.yml +++ /dev/null @@ -1,24 +0,0 @@ -jobs: -- job: build - pool: - vmImage: 'ubuntu-latest' - steps: - - template: step-prepare-environment.yml - - template: step-composer-install.yml - - - template: step-cache-yarn.yml - - - script: yarn inst - displayName: 'yarn install' - - # Update js and css assets eventually - - script: yarn lint:all - displayName: 'Check js and vue lint' - - bash: | - source scripts/ci/fixsecrets.sh - scripts/ci/update-assets.sh - displayName: 'Update assets' - env: - ASSETS_USERNAME: $(ASSETS_USERNAME) - ASSETS_EMAIL: $(ASSETS_EMAIL) - ASSETS_GITHUB_TOKEN: $(ASSETS_GITHUB_TOKEN) diff --git a/.azure/job-reporting.yml b/.azure/job-reporting.yml deleted file mode 100644 index 7febf0c1eee..00000000000 --- a/.azure/job-reporting.yml +++ /dev/null @@ -1,24 +0,0 @@ -jobs: -- job: reporting - dependsOn: - - tests - - tests_browser - pool: - vmImage: 'ubuntu-latest' - steps: - - template: step-prepare-environment.yml - - template: step-composer-install.yml - - - task: DownloadPipelineArtifact@2 - inputs: - path: $(System.DefaultWorkingDirectory)/results - - bash: | - pushd ${SYSTEM_DEFAULTWORKINGDIRECTORY}/results - for f in $(ls); do cp -rf $f/* .; rm -rf $f; done - - - bash: | - yarn global add junit-merge - $(yarn global bin)/junit-merge --recursive --dir results/junit --out results/results.xml - displayName: 'Merge junit files' - - - template: step-runsonar.yml diff --git a/.azure/job-test-browser.yml b/.azure/job-test-browser.yml deleted file mode 100644 index d0021aaca39..00000000000 --- a/.azure/job-test-browser.yml +++ /dev/null @@ -1,20 +0,0 @@ -jobs: -- job: tests_browser - pool: - vmImage: 'ubuntu-latest' - steps: - - template: step-prepare-environment.yml - - template: step-composer-install.yml - - template: step-prepare-db.yml - - template: step-seed-test-db.yml - - - template: step-test-browser.yml - - - bash: | - vendor/bin/phpcov merge --clover=results/coverage0.xml results/coverage/ - rm -rf results/coverage - displayName: 'Fix coverage' - - - template: step-publish-results.yml - parameters: - artifact: results0 diff --git a/.azure/job-test-migrations.yml b/.azure/job-test-migrations.yml deleted file mode 100644 index 422ad9b8014..00000000000 --- a/.azure/job-test-migrations.yml +++ /dev/null @@ -1,10 +0,0 @@ -jobs: -- job: test_migrations - pool: - vmImage: 'ubuntu-latest' - steps: - - template: step-prepare-environment.yml - - template: step-composer-install.yml - - template: step-prepare-db.yml - parameters: - import: false diff --git a/.azure/job-tests.yml b/.azure/job-tests.yml deleted file mode 100644 index a1324ad5e3c..00000000000 --- a/.azure/job-tests.yml +++ /dev/null @@ -1,18 +0,0 @@ -jobs: -- job: tests - pool: - vmImage: 'ubuntu-latest' - strategy: - parallel: 4 - steps: - - template: step-prepare-environment.yml - - template: step-composer-install.yml - - template: step-remove-xdebug.yml - - template: step-prepare-db.yml - - template: step-seed-test-db.yml - - - template: step-test-unit.yml - - - template: step-publish-results.yml - parameters: - artifact: results$(System.JobPositionInPhase) diff --git a/.azure/sign.sh b/.azure/sign.sh deleted file mode 100755 index 9e2b600975b..00000000000 --- a/.azure/sign.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P) - -cat $SELF_PATH/../azure-pipelines.yml $SELF_PATH/*.yml > $SELF_PATH/azure -rm -f $SELF_PATH/azure.sig -gpg --sign --armor --output $SELF_PATH/azure.sig --detach-sig $SELF_PATH/azure || true -gpg --verify $SELF_PATH/azure.sig || true -rm -f $SELF_PATH/azure diff --git a/.azure/step-cache-composer.yml b/.azure/step-cache-composer.yml deleted file mode 100644 index 0cf1fab7c6b..00000000000 --- a/.azure/step-cache-composer.yml +++ /dev/null @@ -1,8 +0,0 @@ -steps: -- task: Cache@2 - inputs: - key: composer-v2 | composer.lock - restoreKeys: | - composer-v2 - path: $(COMPOSER_HOME)/cache - displayName: Cache composer packages diff --git a/.azure/step-cache-sonar.yml b/.azure/step-cache-sonar.yml deleted file mode 100644 index fde1c4ef068..00000000000 --- a/.azure/step-cache-sonar.yml +++ /dev/null @@ -1,17 +0,0 @@ -steps: -- task: Cache@2 - inputs: - key: sonarscanner-v1 | "$(SONAR_VERSION)" | scripts/tests/runsonar.sh - restoreKeys: | - sonarscanner-v1 | "$(SONAR_VERSION)" - sonarscanner-v1 - path: $(HOME)/sonarscanner - displayName: Cache sonar scanner -- task: Cache@2 - inputs: - key: sonarcache-v1 | "$(SONAR_VERSION)" | scripts/tests/runsonar.sh - restoreKeys: | - sonarcache-v1 | "$(SONAR_VERSION)" - sonarcache-v1 - path: $(HOME)/.sonar - displayName: Cache sonar cache diff --git a/.azure/step-cache-yarn.yml b/.azure/step-cache-yarn.yml deleted file mode 100644 index da14b7d6ea7..00000000000 --- a/.azure/step-cache-yarn.yml +++ /dev/null @@ -1,8 +0,0 @@ -steps: -- task: Cache@2 - inputs: - key: yarn-v1 | yarn.lock - restoreKeys: | - yarn-v1 - path: $(YARN_CACHE_FOLDER) - displayName: Cache Yarn packages diff --git a/.azure/step-composer-install.yml b/.azure/step-composer-install.yml deleted file mode 100644 index 789a82f3a07..00000000000 --- a/.azure/step-composer-install.yml +++ /dev/null @@ -1,18 +0,0 @@ -parameters: -- { name: no_dev, type: boolean, default: false } - -steps: -- template: step-cache-composer.yml - -- script: composer validate - displayName: Validate composer files - -- ${{ if not(parameters.no_dev) }}: - - script: echo '##vso[task.setvariable variable=EXTRA_PARAM]' - displayName: Set empty param -- ${{ if parameters.no_dev }}: - - script: echo '##vso[task.setvariable variable=EXTRA_PARAM]--no-dev' - displayName: Set extra param - -- bash: composer install --no-interaction --no-progress --ignore-platform-reqs $EXTRA_PARAM - displayName: composer install diff --git a/.azure/step-prepare-db.yml b/.azure/step-prepare-db.yml deleted file mode 100644 index 5c36500fe52..00000000000 --- a/.azure/step-prepare-db.yml +++ /dev/null @@ -1,19 +0,0 @@ -# database.test.sql file is generated with: -# mysqldump -u homestead -psecret -n --skip-add-drop-table --skip-add-locks --skip-comments monica_test > scripts/database.test.sql -parameters: -- { name: import, type: boolean, default: true } - -steps: -- script: sudo service mysql start - displayName: Start mysql - -- script: mysql --protocol=tcp -u root -proot - -e "CREATE DATABASE IF NOT EXISTS monica CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" - displayName: Create db - -- ${{ if parameters.import }}: - - script: mysql -u root -proot monica < scripts/database.test.sql - displayName: Prepare db - -- script: php artisan migrate --no-interaction -vvv - displayName: Run migration scripts diff --git a/.azure/step-prepare-environment.yml b/.azure/step-prepare-environment.yml deleted file mode 100644 index 9fdec9504d9..00000000000 --- a/.azure/step-prepare-environment.yml +++ /dev/null @@ -1,17 +0,0 @@ -steps: -- bash: | - sudo update-alternatives --set php /usr/bin/php$(phpVersion) - sudo update-alternatives --set phar /usr/bin/phar$(phpVersion) - sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion) - sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion) - sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion) - sudo apt-get update - sudo apt-get install php$(phpVersion)-imagick - php -version - displayName: Set php version $(phpVersion) - -- bash: | - mkdir -p results/coverage - sed 's/DB_TEST_PASSWORD=/DB_TEST_PASSWORD=root/' scripts/ci/.env.mysql > .env - touch .sentry-release - displayName: Prepare environment diff --git a/.azure/step-publish-results.yml b/.azure/step-publish-results.yml deleted file mode 100644 index ff5be378758..00000000000 --- a/.azure/step-publish-results.yml +++ /dev/null @@ -1,16 +0,0 @@ -parameters: -- { name: artifact, type: string, default: 'results' } - -steps: -- task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: JUnit - testResultsFiles: 'results*.xml' - searchFolder: '$(System.DefaultWorkingDirectory)/results/junit' - mergeTestResults: true - condition: succeededOrFailed() - -- publish: $(System.DefaultWorkingDirectory)/results - artifact: ${{ parameters.artifact }} - condition: succeededOrFailed() diff --git a/.azure/step-remove-xdebug.yml b/.azure/step-remove-xdebug.yml deleted file mode 100644 index 2ceb56d76e7..00000000000 --- a/.azure/step-remove-xdebug.yml +++ /dev/null @@ -1,3 +0,0 @@ -steps: -- bash: sudo rm -f /etc/php/$(phpVersion)/cli/conf.d/20-xdebug.ini - displayName: Remove xdebug diff --git a/.azure/step-runsonar.yml b/.azure/step-runsonar.yml deleted file mode 100644 index 89379ccd62c..00000000000 --- a/.azure/step-runsonar.yml +++ /dev/null @@ -1,17 +0,0 @@ -steps: -- script: | - echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)" - echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)\bin;$(PATH)" - displayName: Use Java 11 - -- template: step-cache-sonar.yml - -- bash: | - source scripts/ci/fixsecrets.sh - export SONAR_COVERAGE=$(ls -m ./results/coverage*.xml | sed 's/ //g' | sed ':a;N;$!ba;s/\n//g') - scripts/tests/runsonar.sh - displayName: Run sonar scanner - env: - SONAR_RESULT: '$(System.DefaultWorkingDirectory)/results/results.xml' - SONAR_TOKEN: $(SONAR_TOKEN) - GITHUB_TOKEN: $(GITHUB_TOKEN) diff --git a/.azure/step-seed-test-db.yml b/.azure/step-seed-test-db.yml deleted file mode 100644 index 19321f5cc5f..00000000000 --- a/.azure/step-seed-test-db.yml +++ /dev/null @@ -1,5 +0,0 @@ -steps: -- script: | - php artisan db:seed --no-interaction -vvv - php artisan passport:keys --no-interaction -vvv - displayName: Seed database diff --git a/.azure/step-test-browser.yml b/.azure/step-test-browser.yml deleted file mode 100644 index a4ca85f3058..00000000000 --- a/.azure/step-test-browser.yml +++ /dev/null @@ -1,19 +0,0 @@ -steps: -- bash: | - echo "##vso[task.setvariable variable=DISPLAY]$DISPLAY" - Xvfb ${DISPLAY} -screen 0 1920x1080x24 & - php artisan dusk:chrome-driver $(google-chrome -version | awk '{ print $3 }' | cut -d . -f 1) - ./vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 & - displayName: Launch google chrome - env: - DISPLAY: ':99' - -- bash: | - php -S localhost:8000 -t public scripts/tests/server-cc.php & - php -S localhost:8001 -t public scripts/tests/server-cc.php & - displayName: Run http server - -- script: php artisan dusk --log-junit results/junit/results0.xml - displayName: Run browser tests - env: - CHROME_DRIVER_OPTS: --headless --disable-gpu --disable-dev-shm-usage --no-sandbox --remote-debugging-port=9222 --window-size=1920,1080 diff --git a/.azure/step-test-unit.yml b/.azure/step-test-unit.yml deleted file mode 100644 index 57874d6979f..00000000000 --- a/.azure/step-test-unit.yml +++ /dev/null @@ -1,18 +0,0 @@ -steps: -- bash: | - IFS='|' read -r -a TESTS <<< "$TESTSUITES" - TESTSUITE=${TESTS[$SYSTEM_JOBPOSITIONINPHASE-1]} - echo "TestSuite $TESTSUITE" - echo "##vso[task.setvariable variable=TESTSUITE]$TESTSUITE" - displayName: Select testsuite - env: - TESTSUITES: "Api|Feature|Unit-Models|Unit-Services" - -- bash: | - source scripts/ci/fixsecrets.sh - php artisan route:cache - ulimit -S unlimited - phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --log-junit ./results/junit/results${SYSTEM_JOBPOSITIONINPHASE}.xml --coverage-clover ./results/coverage${SYSTEM_JOBPOSITIONINPHASE}.xml --testsuite $TESTSUITE - displayName: Run unit tests - env: - STRIPE_SECRET: $(STRIPE_SECRET) diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 5f280707b65..00000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,39 +0,0 @@ -# PHP -# Test and package your PHP project. -# Add steps that run tests, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/php - -trigger: - batch: true - branches: - include: - - master - tags: - include: - - '*' -pr: - autoCancel: true - branches: - include: - - '*' - -variables: - - group: Monica - - name: phpVersion - value: 7.4 - - name: COMPOSER_HOME - value: $(Pipeline.Workspace)/.composer - - name: YARN_CACHE_FOLDER - value: $(Pipeline.Workspace)/.yarn - -stages: - - stage: build - displayName: Build - condition: not(startsWith(variables['System.PullRequest.SourceBranch'], 'l10n_master')) - jobs: - - template: .azure/job-build.yml - - template: .azure/job-tests.yml - - template: .azure/job-analyzers.yml - - template: .azure/job-test-browser.yml - - template: .azure/job-reporting.yml - - template: .azure/job-test-migrations.yml diff --git a/scripts/ci/.deploy.json.in b/scripts/ci/.deploy.json.in deleted file mode 100644 index db96aa6fc49..00000000000 --- a/scripts/ci/.deploy.json.in +++ /dev/null @@ -1,31 +0,0 @@ -{ - "package": { - "name": "monica", - "repo": "builds", - "subject": "monicahq", - "desc": "MonicaHQ, the Personal Relationship Manager", - "website_url": "https://www.monicahq.com", - "issue_tracker_url": "https://github.com/monicahq/monica/issues", - "vcs_url": "https://github.com/monicahq/monica.git", - "github_use_tag_release_notes": true, - "github_release_notes_file": "CHANGELOG.md", - "licenses": ["AGPL-V3"], - "labels": [], - "attributes": [] - }, - "version": { - "name": "$(version)", - "desc": "$(description)", - "released": "$(released)", - "vcs_tag": "$(vcs_tag)", - "github_use_tag_release_notes": true, - "attributes": [ - {"name": "commit", "values" : ["$(vcs_commit)"], "type": "string"}, - {"name": "build", "values" : [$(build_number)]} - ] - }, - "files": [ - {"includePattern": "results/(monica.*)", "uploadPattern": "$1"} - ], - "publish": true -} \ No newline at end of file diff --git a/scripts/ci/fixsecrets.sh b/scripts/ci/fixsecrets.sh deleted file mode 100755 index 06fab08dccf..00000000000 --- a/scripts/ci/fixsecrets.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -if [ "$SONAR_TOKEN" == "\$(SONAR_TOKEN)" ]; then - echo -e "\033[0;36mFix SONAR_TOKEN\033[0;37m" - export SONAR_TOKEN= -fi -if [ "$GITHUB_TOKEN" == "\$(GITHUB_TOKEN)" ]; then - echo -e "\033[0;36mFix GITHUB_TOKEN\033[0;37m" - export GITHUB_TOKEN= -fi -if [ "$ASSETS_USERNAME" == "\$(ASSETS_USERNAME)" ]; then - echo -e "\033[0;36mFix ASSETS_USERNAME\033[0;37m" - export ASSETS_USERNAME= -fi -if [ "$ASSETS_EMAIL" == "\$(ASSETS_EMAIL)" ]; then - echo -e "\033[0;36mFix ASSETS_EMAIL\033[0;37m" - export ASSETS_EMAIL= -fi -if [ "$ASSETS_GITHUB_TOKEN" == "\$(ASSETS_GITHUB_TOKEN)" ]; then - echo -e "\033[0;36mFix ASSETS_GITHUB_TOKEN\033[0;37m" - export ASSETS_GITHUB_TOKEN= -fi -if [ "$STRIPE_SECRET" == "\$(STRIPE_SECRET)" ]; then - echo -e "\033[0;36mFix STRIPE_SECRET\033[0;37m" - export STRIPE_SECRET= -fi -if [ "$CYPRESS_RECORD_KEY" == "\$(CYPRESS_RECORD_KEY)" ]; then - echo -e "\033[0;36mFix CYPRESS_RECORD_KEY\033[0;37m" - export CYPRESS_RECORD_KEY= -fi diff --git a/scripts/ci/rebase.sh b/scripts/ci/rebase.sh deleted file mode 100755 index 25b08693e6d..00000000000 --- a/scripts/ci/rebase.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Rebase source on top of based branch - -set -exvo pipefail - -export GIT_COMMIT=$(git rev-parse --verify "HEAD^2" 2>/dev/null || echo $BUILD_SOURCEVERSION) -echo -e "GIT_COMMIT=$GIT_COMMIT" -echo -e "##vso[task.setvariable variable=GIT_COMMIT]$GIT_COMMIT" - -git config checkout.defaultRemote origin -git reset --hard "$GIT_COMMIT" - -if [[ $BUILD_SOURCEBRANCH == refs/tags/* ]]; then - git checkout -q "$BUILD_SOURCEBRANCHNAME" -elif [ -n "$SYSTEM_PULLREQUEST_SOURCEBRANCH" ]; then - git checkout -q -B "$SYSTEM_PULLREQUEST_SOURCEBRANCH" -fi - -#git reset --hard "$GIT_COMMIT" -git log -n1 diff --git a/scripts/tests/runsonar.sh b/scripts/tests/runsonar.sh deleted file mode 100755 index 76b01ebb550..00000000000 --- a/scripts/tests/runsonar.sh +++ /dev/null @@ -1,221 +0,0 @@ -#!/bin/bash - -RUNREVPARSE=false -if [ "$CIRCLECI" == "true" ]; then - if [[ ! -z $CIRCLE_PULL_REQUEST ]] ; then - CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}" - REPO=$CIRCLE_PULL_REQUEST - REPO=${REPO##https://github.com/} - REPO=${REPO%%/pull/$CIRCLE_PR_NUMBER} - else - REPO=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME - fi - BRANCH=${CIRCLE_BRANCH:-$CIRCLE_TAG} - PR_NUMBER=${CIRCLE_PR_NUMBER:-false} - BUILD_NUMBER=$CIRCLE_BUILD_NUM - GIT_COMMIT=$CIRCLE_SHA1 - RUNREVPARSE=true -elif [ "$TRAVIS" == "true" ]; then - REPO=$TRAVIS_REPO_SLUG - BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} - PR_NUMBER=$TRAVIS_PULL_REQUEST - BUILD_NUMBER=$TRAVIS_BUILD_NUMBER - GIT_COMMIT=${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT} -elif [ "$TF_BUILD" == "True" ]; then - REPO=$BUILD_REPOSITORY_NAME - BRANCH=${SYSTEM_PULLREQUEST_SOURCEBRANCH:-$BUILD_SOURCEBRANCHNAME} - PR_NUMBER=${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-false} - BUILD_NUMBER=$BUILD_BUILDNUMBER - if [[ -z $GIT_COMMIT ]]; then - GIT_COMMIT=$(git rev-parse --verify "HEAD^2" 2>/dev/null || echo $BUILD_SOURCEVERSION) - fi -elif [[ -n $BUILD_NUMBER ]]; then - echo "CHANGE_ID=$CHANGE_ID" - echo "CHANGE_URL=$CHANGE_URL" - REPO=${CHANGE_URL##https://github.com/} - if [[ ! -z $CHANGE_ID ]] ; then - REPO=${REPO%%/pull/$CHANGE_ID} - fi - PR_NUMBER=${CHANGE_ID:-false} - BRANCH=$BRANCH_NAME -fi - -echo "REPO=$REPO" -echo "BRANCH=$BRANCH" -echo "PR_NUMBER=$PR_NUMBER" -echo "BUILD_NUMBER=$BUILD_NUMBER" -echo "GIT_COMMIT=$GIT_COMMIT" - -set -euo pipefail - -REPOSITORY_OWNER=monicahq/monica -SONAR_ORGANIZATION=monicahq - -function installSonar { - echo '== Setup sonar scanner' - - # set version of sonar scanner to use : - sonarversion=${SONAR_VERSION:-} - if [ -z "${sonarversion:-}" ]; then - sonarversion=4.3.0.2102 - fi - echo "== Using sonarscanner $sonarversion" - - mkdir -p $HOME/sonarscanner - pushd $HOME/sonarscanner > /dev/null - if [ ! -d "sonar-scanner-$sonarversion" ]; then - echo "== Downloading sonarscanner $sonarversion" - java_path=$(which java || true) - if [ -x "$java_path" ]; then - wget --quiet --continue https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$sonarversion.zip - unzip -q sonar-scanner-cli-$sonarversion.zip - rm sonar-scanner-cli-$sonarversion.zip - else - wget --quiet --continue https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$sonarversion-linux.zip - unzip -q sonar-scanner-cli-$sonarversion-linux.zip - rm sonar-scanner-cli-$sonarversion-linux.zip - mv sonar-scanner-$sonarversion-linux sonar-scanner-$sonarversion - fi - else - pushd sonar-scanner-$sonarversion > /dev/null - chmod a+x bin/sonar-scanner - test -f jre/bin/java && chmod a+x jre/bin/java - popd > /dev/null - fi - export SONAR_SCANNER_HOME=$HOME/sonarscanner/sonar-scanner-$sonarversion - export PATH=$SONAR_SCANNER_HOME/bin:$PATH - popd > /dev/null -} - -function CommonParams { - extra="" - if [ "$REPO" != "$REPOSITORY_OWNER" ]; then - # Avoid forks to send reports to the same project - project="${REPO/\//_}" - extra="$extra -Dsonar.projectKey=monica:$project -Dsonar.projectName=$project" - fi - - echo -Dsonar.host.url=$SONAR_HOST_URL \ - -Dsonar.organization=$SONAR_ORGANIZATION \ - -Dsonar.php.tests.reportPath=$SONAR_RESULT \ - -Dsonar.php.coverage.reportPaths=$SONAR_COVERAGE \ - -Dsonar.analysis.buildNumber=$BUILD_NUMBER \ - -Dsonar.analysis.pipeline=$BUILD_NUMBER \ - -Dsonar.analysis.sha1=$GIT_COMMIT \ - -Dsonar.analysis.repository=$REPO \ - $extra -} - -function gitFetch { - echo '== gitFetch' - echo '# git fetch --all' - git fetch --all - if [ "$RUNREVPARSE" == "true" ]; then - if [ -n "${PULL_REQUEST_BASEBRANCH:-}" ]; then - echo "# git branch -D $PULL_REQUEST_BASEBRANCH" - git branch -D $PULL_REQUEST_BASEBRANCH || true - echo "# git rev-parse origin/$PULL_REQUEST_BASEBRANCH" - git rev-parse origin/$PULL_REQUEST_BASEBRANCH - fi - fi - echo '' -} - -function getSonarlauncher { - sonarlauncherversion=0.7.0 - mkdir -p ~/sonarlauncher - pushd ~/sonarlauncher > /dev/null - if [ ! -d "$sonarlauncherversion" ]; then - echo "== Download sonarlauncher $sonarlauncherversion" - mkdir -p ~/sonarlauncher/$sonarlauncherversion - curl -sSL https://github.com/monicahq/sonarlauncher/releases/download/$sonarlauncherversion/sonarlauncher.tar | tar x -C ~/sonarlauncher/$sonarlauncherversion - fi - popd > /dev/null - cp ~/sonarlauncher/$sonarlauncherversion/sonarlauncher . -} - -if [ -z "${SONAR_HOST_URL:-}" ]; then - export SONAR_HOST_URL=https://sonarcloud.io -fi - -if [ "$BRANCH" == "master" ] && [ "$PR_NUMBER" == "false" ] && [ -n "${SONAR_TOKEN:-}" ]; then - echo '==========================' - echo '== SONAR:Analyze master ==' - echo '==========================' - installSonar - gitFetch - - SONAR_PARAMS="$(CommonParams) \ - -Dsonar.projectVersion=master" - - echo "# sonar-scanner $SONAR_PARAMS" - $SONAR_SCANNER_HOME/bin/sonar-scanner $SONAR_PARAMS -Dsonar.login=$SONAR_TOKEN - exit $? - -elif [ -n "${BRANCH:-}" ] && [ "$PR_NUMBER" == "false" ] && [ -n "${SONAR_TOKEN:-}" ]; then - echo '==================================' - echo '== SONAR:Analyze release branch ==' - echo '==================================' - installSonar - gitFetch - - SONAR_PARAMS="$(CommonParams) \ - -Dsonar.projectVersion=$(php artisan monica:getversion)" - - echo "# sonar-scanner $SONAR_PARAMS" - $SONAR_SCANNER_HOME/bin/sonar-scanner $SONAR_PARAMS -Dsonar.login=$SONAR_TOKEN - exit $? - -elif [ "$PR_NUMBER" != "false" ] && [ -n "${SONAR_TOKEN:-}" ] && [ -n "${GITHUB_TOKEN:-}" ]; then - - REPOS_VALUES=($(curl -H "Authorization: token $GITHUB_TOKEN" -sSL https://api.github.com/repos/$REPO/pulls/$PR_NUMBER | jq -r -c ".head.repo.full_name, .head.repo.owner.login, .base.ref, .head.ref")) - - PULL_REQUEST_BRANCH= - PULL_REQUEST_REPOSITORY=${REPOS_VALUES[0]} - PULL_REQUEST_USER=${REPOS_VALUES[1]} - PULL_REQUEST_BASEBRANCH=${REPOS_VALUES[2]} - PULL_REQUEST_HEADBRANCH=${REPOS_VALUES[3]} - - if [ -z "${PULL_REQUEST_REPOSITORY:-}" ] || [ "$PULL_REQUEST_REPOSITORY" == "null" ]; then - echo '== Error with github api call' - exit 11 - elif [ "$PULL_REQUEST_REPOSITORY" == "$REPOSITORY_OWNER" ]; then - echo '=========================================' - echo '== SONAR:Analyze internal pull request ==' - echo '=========================================' - PULL_REQUEST_BRANCH=$PULL_REQUEST_HEADBRANCH - else - echo '=========================================' - echo '== SONAR:Analyze external pull request ==' - echo '=========================================' - echo "== External repository: $PULL_REQUEST_REPOSITORY" - PULL_REQUEST_BRANCH="${PULL_REQUEST_USER}__$PULL_REQUEST_HEADBRANCH" - fi - echo "PULL_REQUEST_BRANCH=$PULL_REQUEST_BRANCH" - echo "PULL_REQUEST_REPOSITORY=$PULL_REQUEST_REPOSITORY" - echo "PULL_REQUEST_USER=$PULL_REQUEST_USER" - echo "PULL_REQUEST_BASEBRANCH=$PULL_REQUEST_BASEBRANCH" - echo "PULL_REQUEST_HEADBRANCH=$PULL_REQUEST_HEADBRANCH" - - installSonar - gitFetch - - SONAR_PARAMS="$(CommonParams) \ - -Dsonar.pullrequest.key=$PR_NUMBER \ - -Dsonar.pullrequest.base=$PULL_REQUEST_BASEBRANCH \ - -Dsonar.pullrequest.branch=$PULL_REQUEST_BRANCH \ - -Dsonar.pullrequest.provider=GitHub \ - -Dsonar.pullrequest.github.repository=$REPO" - - echo "# sonar-scanner $SONAR_PARAMS" - $SONAR_SCANNER_HOME/bin/sonar-scanner $SONAR_PARAMS -Dsonar.login=$SONAR_TOKEN - exit $? - -elif [ ! -x "sonarlauncher" ]; then - - getSonarlauncher - echo '===== Run sonar launcher =====' - ./sonarlauncher - exit $? - -fi diff --git a/scripts/tests/runsonar.sh.sig b/scripts/tests/runsonar.sh.sig deleted file mode 100644 index 0847c3399f4..00000000000 --- a/scripts/tests/runsonar.sh.sig +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEEuNgCced4O/05ANeg4OezJU6ORAcFAl7mE1wACgkQ4OezJU6O -RAdeWRAAog33nvJ/iWsvo1uh7fcg+i/jogjm4I5tQqBnX9OoIdR7fw87RFZ09aFb -hHYsEb+ZOW5rgfRDnM2KuR4kQ+SyMamRKd29yyLMSwrlHUdWHM81uev2hqwEF7mT -iymOGVRvXAGe6QrQ+MsXkAdih+d/jbaQxwCYG5JcCQ3Zr5P9ZcOGJr+1ZDBRtb+7 -dtPSL6hEKGtwUsVU9xyPuKaK8dv4von6QtSJGyj+5eX2NIklsElPba/ukv/HrdVD -TxtF0rHn+6KXr3ZD/987EG1N3CCEXugN30E2bmJXw+jER5swJ+pQ7t0mpAZ5N9MN -U2780DOV2sQU3bsP7pfWg2uv7VvwfxfZUFw+Kc/iL5zyfZ6liH0T6cOCrYbiOFVa -w+uoK6zDR6PPdW1AkkY9cACndxB+7/fNJJe1nYh8K9GgimFDKkIKiYPispra3Hli -v1ZA3wGF+mcfGMRH32EfOgUTWo+Il80Ctu0K6z2+GK+k+Ayxf97wvqSyHg+x9Jv6 -P6ZdO2m2ybAGo4AVl067zWltGU9p0H6mDXBvFMx7uepQfkrBOQquwOp5g2SlNh2s -43Sw4XGLBP+yr5x0MuUODrFW1crLRDgHvCjDVPSNRfexhYSL2H5RHu9VoNPcsSdu -HPZqtO5CJmJJC2IQCiYxI7GKp8tGwznyIS7x+DiQMwc+BXG9+X0= -=A98D ------END PGP SIGNATURE----- diff --git a/sonar-project.properties b/sonar-project.properties index ef3e1295c7d..f33d604b797 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,16 +1,15 @@ # must be unique in a given SonarQube instance sonar.projectKey=monica -# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1. sonar.projectName=monica -#sonar.projectVersion= sonar.organization=monicahq -#sonar.host.url=https://sonarcloud.io # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. # This property is optional if sonar.modules is set. -sonar.sources=app,bootstrap,config,public,resources,routes -#sonar.exclusions=bootstrap/cache/*,public/css/*,public/js/*,public/storage/* +sonar.sources=app,bootstrap,config,database,public,resources,routes +sonar.exclusions=bootstrap/cache/*,public/vendor/**,resources/lang/** sonar.tests=tests +sonar.coverage.exclusions=routes/*.php,config/*.php,bootstrap/**,resources/**/*.php,database/factories/*,database/migrations/*.php,public/*.php,resources/**/*.vue,resources/**/*.js +sonar.cpd.exclusions=routes/*.php,config/*.php,bootstrap/**,resources/**/*.php,database/**/*.php # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 From 8b034fde3150ba7bb7ac2f91cce4b8856160b30e Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Fri, 26 Feb 2021 09:28:09 +0100 Subject: [PATCH 39/45] tests --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3acd1eb965c..ebd149158fc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -112,7 +112,7 @@ jobs: - name: Run Unit test suite run: | php artisan route:cache - phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --testsuite ${{ matrix.testsuite }} --log-junit ./results/junit/results${{ matrix.testsuite }}.xml --coverage-clover ./results/coverage${{ matrix.testsuite }}.xml + phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit --debug -c phpunit.xml --testsuite ${{ matrix.testsuite }} --log-junit ./results/junit/results${{ matrix.testsuite }}.xml --coverage-clover ./results/coverage${{ matrix.testsuite }}.xml env: DB_CONNECTION: ${{ matrix.connection }} From 2ea4e4a49ee88e2f74ce2ccec7205ec0fbcba384 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Fri, 26 Feb 2021 18:20:32 +0100 Subject: [PATCH 40/45] and --- .github/workflows/tests.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ebd149158fc..40820b0053f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -107,12 +107,18 @@ jobs: run: php artisan db:seed --no-interaction -vvv - name: Create passport keys run: php artisan passport:keys --no-interaction -vvv + - name: Cache route + run: php artisan route:cache # Test - name: Run Unit test suite - run: | - php artisan route:cache - phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit --debug -c phpunit.xml --testsuite ${{ matrix.testsuite }} --log-junit ./results/junit/results${{ matrix.testsuite }}.xml --coverage-clover ./results/coverage${{ matrix.testsuite }}.xml + if: matrix.php-version == '7.4' + run: phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --testsuite ${{ matrix.testsuite }} --log-junit ./results/junit/results${{ matrix.testsuite }}.xml --coverage-clover ./results/coverage${{ matrix.testsuite }}.xml + env: + DB_CONNECTION: ${{ matrix.connection }} + - name: Run Unit test suite + if: matrix.php-version != '7.4' + run: vendor/bin/phpunit -c phpunit.xml --testsuite ${{ matrix.testsuite }} env: DB_CONNECTION: ${{ matrix.connection }} @@ -234,6 +240,8 @@ jobs: run: php artisan db:seed --no-interaction -vvv - name: Create passport keys run: php artisan passport:keys --no-interaction -vvv + - name: Cache route + run: php artisan route:cache # Test - name: Upgrade Chrome Driver From a247d6b4a877dd2c3fcb41c8e2b7fd319853d71d Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Fri, 26 Feb 2021 23:33:05 +0100 Subject: [PATCH 41/45] it's --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40820b0053f..8b650127596 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -123,6 +123,7 @@ jobs: DB_CONNECTION: ${{ matrix.connection }} - name: Fix results files + if: matrix.php-version == '7.4' run: sed -i -e "s%$GITHUB_WORKSPACE/%%g" results/*/*.xml - name: Store results From bbac13dc1849d0412d851af2d6e0865f4cad3875 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sat, 27 Feb 2021 18:24:13 +0100 Subject: [PATCH 42/45] making --- .github/workflows/tests.yml | 46 +++++++++++++++---------------------- scripts/ci/.env.mysql | 4 ++-- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8b650127596..7b7a73d8be4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,18 +21,6 @@ jobs: runs-on: ubuntu-latest name: Unit tests on ${{ matrix.connection }} Testsuite ${{ matrix.testsuite }} (PHP ${{ matrix.php-version }}) - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: true - MYSQL_USER: monica - MYSQL_DATABASE: monica - MYSQL_PASSWORD: secret - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - strategy: fail-fast: false matrix: @@ -98,8 +86,15 @@ jobs: - name: Generate key run: php artisan key:generate - - name: Prepare db - run: mysql -h 127.0.0.1 -P 3306 -u monica -psecret monica < scripts/database.test.sql + - name: Start mysql + if: matrix.connection == 'mysql' + run: sudo systemctl start mysql.service + - name: Create database + if: matrix.connection == 'mysql' + run: mysql --protocol=tcp -u root -proot -e "CREATE DATABASE IF NOT EXISTS monica CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" + - name: Prepare database + if: matrix.connection == 'mysql' + run: mysql --protocol=tcp -u root -proot monica < scripts/database.test.sql - name: Run migrations run: php artisan migrate --no-interaction -vvv @@ -141,18 +136,6 @@ jobs: runs-on: ubuntu-latest name: Tests browser on ${{ matrix.connection }} (PHP ${{ matrix.php-version }}) - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: true - MYSQL_USER: monica - MYSQL_DATABASE: monica - MYSQL_PASSWORD: secret - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - strategy: fail-fast: false matrix: @@ -232,8 +215,15 @@ jobs: - name: Generate key run: php artisan key:generate - - name: Prepare db - run: mysql -h 127.0.0.1 -P 3306 -u monica -psecret monica < scripts/database.test.sql + - name: Start mysql + if: matrix.connection == 'mysql' + run: sudo systemctl start mysql.service + - name: Create database + if: matrix.connection == 'mysql' + run: mysql --protocol=tcp -u root -proot -e "CREATE DATABASE IF NOT EXISTS monica CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" + - name: Prepare database + if: matrix.connection == 'mysql' + run: mysql --protocol=tcp -u root -proot monica < scripts/database.test.sql - name: Run migrations run: php artisan migrate --no-interaction -vvv diff --git a/scripts/ci/.env.mysql b/scripts/ci/.env.mysql index 5cdcfa3744b..b000832f864 100644 --- a/scripts/ci/.env.mysql +++ b/scripts/ci/.env.mysql @@ -8,8 +8,8 @@ DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=monica -DB_USERNAME=monica -DB_PASSWORD=secret +DB_USERNAME=root +DB_PASSWORD=root DB_USE_UTF8MB4=true BROADCAST_DRIVER=log From 4a36be2095fda592b161332d1ae188b6b6c69334 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sat, 27 Feb 2021 18:26:15 +0100 Subject: [PATCH 43/45] me --- .github/workflows/migration_tests.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/migration_tests.yml b/.github/workflows/migration_tests.yml index 6241f5a12f4..c9616de4845 100644 --- a/.github/workflows/migration_tests.yml +++ b/.github/workflows/migration_tests.yml @@ -21,18 +21,6 @@ jobs: runs-on: ubuntu-latest name: Test migration on ${{ matrix.connection }} (PHP ${{ matrix.php-version }}) - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: true - MYSQL_USER: monica - MYSQL_DATABASE: monica - MYSQL_PASSWORD: secret - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - strategy: fail-fast: false matrix: @@ -80,7 +68,17 @@ jobs: - name: Prepare environment run: cp scripts/ci/.env.${{ matrix.connection }} .env + - name: Start mysql + if: matrix.connection == 'mysql' + run: sudo systemctl start mysql.service + - name: Create database + if: matrix.connection == 'mysql' + run: mysql --protocol=tcp -u root -proot -e "CREATE DATABASE IF NOT EXISTS monica CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" + - name: Prepare database + if: matrix.connection == 'mysql' + run: mysql --protocol=tcp -u root -proot monica < scripts/database.test.sql - name: Run migrations run: php artisan migrate --no-interaction -vvv + - name: Run seeds run: php artisan db:seed --no-interaction -vvv From 4cdb85977e73966787ba4a3f62b350e1ac665f51 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sat, 27 Feb 2021 20:55:11 +0100 Subject: [PATCH 44/45] happy --- .github/workflows/cypress.yml | 24 ++++++++---------------- .github/workflows/tests.yml | 26 ++++++++++++-------------- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 7ca55413978..5a145a3d3de 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -10,18 +10,6 @@ jobs: if: contains(github.event.pull_request.labels.*.name, 'cypress') name: Cypress tests with ${{ matrix.browser }} (PHP ${{ matrix.php-version }}) - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: true - MYSQL_USER: monica - MYSQL_DATABASE: monica - MYSQL_PASSWORD: secret - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - strategy: fail-fast: false matrix: @@ -94,17 +82,21 @@ jobs: # Prepare - name: Prepare environment run: | - mkdir -p results/coverage cp scripts/ci/.env.mysql .env touch config/.version config/.release .sentry-release .sentry-commit + mkdir -p results/coverage echo "REQUIRES_SUBSCRIPTION=true" >> .env - name: Generate key run: php artisan key:generate - - name: Prepare db - run: mysql -h 127.0.0.1 -P 3306 -u monica -psecret monica < scripts/database.test.sql - - name: Run migration scripts + - name: Start mysql + run: sudo systemctl start mysql.service + - name: Create database + run: mysql --protocol=tcp -u root -proot -e "CREATE DATABASE IF NOT EXISTS monica CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" + - name: Prepare database + run: mysql --protocol=tcp -u root -proot monica < scripts/database.test.sql + - name: Run migrations run: php artisan migrate --no-interaction -vvv - name: Run seeds diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b7a73d8be4..7629bc1064e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,18 +70,17 @@ jobs: run: | cp scripts/ci/.env.${{ matrix.connection }} .env touch config/.version config/.release .sentry-release .sentry-commit - mkdir -p results/coverage - mkdir -p public/js - mkdir -p public/css - echo "{" > public/mix-manifest.json - for f in app.js manifest.js vendor.js app-ltr.css app-rtl.css stripe.js stripe.css; do - [[ $first == 1 ]] && echo -n "," >> public/mix-manifest.json || first=1 - k=${f##*.}/$f - echo "\"/$k\": \"/$k\"" >> public/mix-manifest.json - echo '' > public/$k - done - echo "}" >> public/mix-manifest.json - cat public/mix-manifest.json + mkdir -p public/js public/css results/coverage + {\ + echo "{"; \ + for f in app.js manifest.js vendor.js app-ltr.css app-rtl.css stripe.js stripe.css; do \ + [[ $first == 1 ]] && echo -n "," || first=1; \ + k=${f##*.}/$f; \ + echo "\"/$k\": \"/$k\""; \ + echo '' > public/$k; \ + done \ + echo "}"; \ + } | tee public/mix-manifest.json - name: Generate key run: php artisan key:generate @@ -208,8 +207,7 @@ jobs: run: | cp scripts/ci/.env.${{ matrix.connection }} .env touch config/.version config/.release .sentry-release .sentry-commit - mkdir -p results/coverage - mkdir -p results/console + mkdir -p results/coverage results/console chmod -R 777 storage bootstrap/cache - name: Generate key From dd5439f4e7a19134b3db7836d32aafe0de780b74 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sat, 27 Feb 2021 21:00:30 +0100 Subject: [PATCH 45/45] but --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7629bc1064e..94c83681666 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,7 @@ jobs: k=${f##*.}/$f; \ echo "\"/$k\": \"/$k\""; \ echo '' > public/$k; \ - done \ + done; \ echo "}"; \ } | tee public/mix-manifest.json