fix: missing .env file during tests (#31) #18
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: Automatic Versioning and Release | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
- name: Configure .env file | |
run: | | |
cp .env.example .env | |
mkdir -p var/logs | |
touch var/logs/app.log | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Run tests | |
run: composer run-script test | |
# run this job only if the tests pass | |
release: | |
needs: tests | |
if: ${{ needs.tests.result == 'success' }} | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to be able to create releases | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Format Code | |
run: composer run-script format | |
- name: Clean Dev Dependencies | |
run: | | |
rm -rf ./vendor | |
composer install --no-dev | |
- name: Release | |
id: semver | |
uses: huggingface/semver-release-action@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |