Continuous Integration #140
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: Continuous Integration | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: "55 9 * * *" | |
jobs: | |
run_tests: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
env: | |
DB_CONN_STR: ${{ vars.DB_CONN_STR }} | |
DB_USERNAME: ${{ vars.DB_USERNAME }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "8.2" | |
extensions: mbstring, json, pdo, curl | |
ini-values: post_max_size=256M, upload_max_filesize=256M, memory_limit=2G | |
coverage: none | |
- name: Install Couchbase PHP extension | |
run: | | |
sudo pecl install couchbase | |
echo "extension=couchbase.so" | sudo tee -a $(php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||") | |
- name: Verify Couchbase PHP extension installation | |
run: php -m | grep -i couchbase | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --optimize-autoloader | |
- name: Copy .env file | |
run: cp .env.example .env | |
- name: Generate application key | |
run: php artisan key:generate | |
- name: Run tests | |
# run: vendor/bin/phpunit --coverage-text --colors=never | |
run: php artisan test | |
- name: Report Status | |
if: always() | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notify_when: "failure,warnings" | |
notification_title: "Repo: *{repo}*" | |
message_format: "{emoji} *{status_message}* in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>" | |
footer: "<{run_url}|View Full Run on GitHub>" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |