name: Unit Tests on: push: branches: [ "main", "develop" ] pull_request: branches: [ "main", "develop" ] permissions: contents: read jobs: unit-tests: runs-on: ubuntu-latest env: OPENAI_SECRET_KEY: ${{ secrets.OPENAI_SECRET_KEY }} OPENAI_ACCESS_TOKEN: ${{ secrets.OPENAI_ACCESS_TOKEN }} steps: - uses: actions/checkout@v3 - name: Validate composer.json and composer.lock run: composer validate --strict - name: Install dependencies run: composer install --prefer-dist --no-progress - name: Cache Composer packages id: composer-cache uses: actions/cache@v3 with: path: vendor key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - name: Run test suite run: composer run-script test