Skip to content

Commit

Permalink
UHF-11137: More testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Dec 18, 2024
1 parent 9293ea8 commit 04f48c0
Showing 1 changed file with 1 addition and 57 deletions.
58 changes: 1 addition & 57 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 04f48c0

Please sign in to comment.