-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69485fc
commit 9ed696c
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: GitHub Action | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the code | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Build Docker containers | ||
- name: Build containers | ||
run: docker compose -f docker-compose.dev.yml up -d --force-recreate --build | ||
|
||
# Application configuration | ||
- name: Configure application | ||
run: | | ||
docker exec -i local /bin/bash -c 'composer update' | ||
docker exec -i local /bin/bash -c '/usr/local/bin/php artisan config:clear' | ||
docker exec -i local /bin/bash -c '/usr/local/bin/php artisan cache:clear' | ||
docker exec -i local /bin/bash -c '/usr/local/bin/php artisan view:clear' | ||
docker exec -i local /bin/bash -c '/usr/local/bin/php artisan DBConnection' | ||
docker exec -i local /bin/bash -c '/usr/local/bin/php artisan migrate' | ||
env: | ||
# Add any environment variables here if needed | ||
APP_ENV: testing | ||
|
||
# Run PHPUnit tests | ||
- name: Run PHPUnit tests | ||
run: docker exec -i local /bin/bash -c '/usr/local/bin/php artisan test' | ||
|
||
# Run Larastan static analysis | ||
- name: Larastan analysis | ||
run: docker exec -i local /bin/bash -c './vendor/bin/phpstan analyse --generate-baseline --memory-limit=2G' | ||
|
||
# Cleanup after the job | ||
- name: Cleanup resources | ||
run: | | ||
docker compose -f docker-compose.dev.yml down | ||
docker volume prune -f | ||
docker image prune -f |