unit-tests.yml 935 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Unit Tests
  2. on:
  3. push:
  4. branches: [ "main", "develop" ]
  5. pull_request:
  6. branches: [ "main", "develop" ]
  7. permissions:
  8. contents: read
  9. jobs:
  10. unit-tests:
  11. runs-on: ubuntu-latest
  12. env:
  13. OPENAI_SECRET_KEY: ${{ secrets.OPENAI_SECRET_KEY }}
  14. OPENAI_ACCESS_TOKEN: ${{ secrets.OPENAI_ACCESS_TOKEN }}
  15. steps:
  16. - uses: actions/checkout@v3
  17. - name: Validate composer.json and composer.lock
  18. run: composer validate --strict
  19. - name: Install dependencies
  20. run: composer install --prefer-dist --no-progress
  21. - name: Cache Composer packages
  22. id: composer-cache
  23. uses: actions/cache@v3
  24. with:
  25. path: vendor
  26. key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
  27. restore-keys: |
  28. ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
  29. - name: Run test suite
  30. run: composer run-script test