Fix/test work flow #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHPUnit Test | |
on: | |
push: | |
pull_request: | |
concurrency: | |
group: test | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v2 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
- name: Create Environment File | |
run: echo "TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }}" > .env | |
- name: Create Environment File test user id | |
run: echo "TEST_USER_ID=${{ secrets.TEST_USER_ID }}" >> .env | |
- name: Install Composer packages | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Run PHPUnit tests | |
run: ./vendor/bin/phpunit |