From 04f48c033461d22c5cef3617da4876e95848f4d0 Mon Sep 17 00:00:00 2001 From: tuutti Date: Wed, 18 Dec 2024 10:16:22 +0200 Subject: [PATCH] UHF-11137: More testing --- .github/workflows/test.yml | 58 +------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53495342..d2cfa641 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,60 +5,4 @@ on: name: CI jobs: tests: - runs-on: ubuntu-latest - steps: - - - name: Make sure configuration was exported in correct language (en or und) - run: | - OUTPUT=$(grep -oP '^langcode: \b(?!(?:en|und)\b)\w+' conf -R || true) - - if [ ! -z "$OUTPUT" ]; then - echo "Found configuration that does not match the pattern 'langcode: (en|und)':" >> $GITHUB_STEP_SUMMARY - echo "$OUTPUT" >> $GITHUB_STEP_SUMMARY - exit 1 - fi - - - name: Run tests - uses: city-of-helsinki/drupal-gh-actions/.github/workflows/project-tests.yml@main - - - name: Check that subtheme is not built with dev mode - run: docker compose exec app bash -c "if grep -q 'sourceMappingURL=' -R public/themes/custom/hdbt_subtheme/dist/css; then exit 1; fi" - - - name: Run PHPCS - run: | - docker compose exec app bash -c "vendor/bin/phpcs public/modules/custom/" - docker compose exec app bash -c "vendor/bin/phpcs public/themes/custom/" - - - name: Run phpstan - run: docker compose exec app bash -c "vendor/bin/phpstan analyze" - - - name: Download latest dump - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh run download -n latest.sql - - - name: Install Drupal - run: | - docker compose exec app bash -c "mysql --user=drupal --password=drupal --database=drupal --host=db --port=3306 -A < latest.sql" - docker compose exec app bash -c "drush deploy" - - - name: Run PHPUnit tests - run: | - docker compose exec app bash -c "mkdir -p /app/results" - - if [ -d "tests/" ]; then - docker compose exec app bash -c "composer test-php tests/" - fi - docker compose exec app bash -c "composer test-php public/modules/custom" - - - name: Export logs - if: always() - run: docker compose logs app > results/service.log - - - name: Create an artifact from test report - uses: actions/upload-artifact@v4 - if: always() - with: - name: results - path: results/ - retention-days: 1 + uses: city-of-helsinki/.github/workflows/project-tests.yml@main