From 70ad6e600b33d7e820563a5c9da6ffcc5dd3b613 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 10:07:08 +0200 Subject: [PATCH 01/21] BZR-62: add first workflow draft --- .github/workflows/codecov.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..4f51c2e --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,29 @@ +name: test-coverage +on: + workflow_dispatch: + pull_request: + types: + - opened + branches: + - 'master' + push: + branches: + - 'master' + - 'BZR-**' +jobs: + run-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: docker --version + # - run: | + # cp .env.example .env + # docker-compose -f docker-compose.dev.yml up --build -d + # docker exec -it buzzer_app bash + # composer install + # php artisan key:generate + # php artisan migrate --seed + # - name: Upload coverage reports to Codecov + # uses: codecov/codecov-action@v3 + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From ca03d931ec56d5560d1c89ac42d9e35f97b02c87 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 14:12:00 +0200 Subject: [PATCH 02/21] BZR-62: build containers --- .github/workflows/codecov.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 4f51c2e..eca2932 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,14 +15,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: docker --version - # - run: | - # cp .env.example .env - # docker-compose -f docker-compose.dev.yml up --build -d - # docker exec -it buzzer_app bash - # composer install - # php artisan key:generate - # php artisan migrate --seed + - run: | + cp .env.example .env + docker-compose -f docker-compose.dev.yml up --build -d + docker exec -it buzzer_app bash + composer install + php artisan key:generate + php artisan migrate # - name: Upload coverage reports to Codecov # uses: codecov/codecov-action@v3 # env: From a70f9296d7f219177b4b4d32891c0c124943ccd6 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 14:20:31 +0200 Subject: [PATCH 03/21] BZR-62: fix docker flag --- .github/workflows/codecov.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index eca2932..ca2594f 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -9,7 +9,6 @@ on: push: branches: - 'master' - - 'BZR-**' jobs: run-tests: runs-on: ubuntu-latest @@ -18,7 +17,7 @@ jobs: - run: | cp .env.example .env docker-compose -f docker-compose.dev.yml up --build -d - docker exec -it buzzer_app bash + docker exec -i buzzer_app bash composer install php artisan key:generate php artisan migrate From 3cc6ab172185e38badd15109bb48b6bf7ab80566 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 14:24:30 +0200 Subject: [PATCH 04/21] BZR-62: remove -it flag --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index ca2594f..f78ab1c 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -17,7 +17,7 @@ jobs: - run: | cp .env.example .env docker-compose -f docker-compose.dev.yml up --build -d - docker exec -i buzzer_app bash + docker exec buzzer_app bash composer install php artisan key:generate php artisan migrate From 9d516a715d827cc6676b63c7e58e5a4463402f6b Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 14:42:23 +0200 Subject: [PATCH 05/21] BZR-62: try to run composer install --- .github/workflows/codecov.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index f78ab1c..2bea5a9 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -17,10 +17,10 @@ jobs: - run: | cp .env.example .env docker-compose -f docker-compose.dev.yml up --build -d - docker exec buzzer_app bash - composer install - php artisan key:generate - php artisan migrate + docker exec -i buzzer_app composer install + + # php artisan key:generate + # php artisan migrate # - name: Upload coverage reports to Codecov # uses: codecov/codecov-action@v3 # env: From 6c9b94fce157128e00da3dd2d7fff6dd579204f1 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 14:45:18 +0200 Subject: [PATCH 06/21] BZR-62: add branch push hook --- .github/workflows/codecov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 2bea5a9..bababbc 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -9,6 +9,7 @@ on: push: branches: - 'master' + - 'BZR-**' jobs: run-tests: runs-on: ubuntu-latest From 0ac65dfcb27e3e5d76c73c9c2d50a66a0f676461 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 15:04:52 +0200 Subject: [PATCH 07/21] BZR-62: add bash session --- .github/workflows/codecov.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index bababbc..2ae4bbd 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,7 +18,8 @@ jobs: - run: | cp .env.example .env docker-compose -f docker-compose.dev.yml up --build -d - docker exec -i buzzer_app composer install + docker exec -i buzzer_app bash + php artisan composer install # php artisan key:generate # php artisan migrate From c10b103e6b01f576f65311bc9cd7e5e7f2d2feba Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 15:10:50 +0200 Subject: [PATCH 08/21] BZR-62: add user id export and check --- .github/workflows/codecov.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 2ae4bbd..706f531 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -17,9 +17,10 @@ jobs: - uses: actions/checkout@v3 - run: | cp .env.example .env + export UID docker-compose -f docker-compose.dev.yml up --build -d - docker exec -i buzzer_app bash - php artisan composer install + docker exec -i sendy_app id + docker exec -i buzzer_app composer install # php artisan key:generate # php artisan migrate From ff05b41b47c96e9b9e6b700b39132ea684ffbf8f Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 15:15:07 +0200 Subject: [PATCH 09/21] BZR-62: fix app name --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 706f531..ef58fab 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -19,7 +19,7 @@ jobs: cp .env.example .env export UID docker-compose -f docker-compose.dev.yml up --build -d - docker exec -i sendy_app id + docker exec -i buzzer_app id docker exec -i buzzer_app composer install # php artisan key:generate From ee3b3e4dd5bf611e25f7d22668c3283b65cf0ce7 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 15:30:41 +0200 Subject: [PATCH 10/21] BZR-62: try as root --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index ef58fab..17919eb 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -20,7 +20,7 @@ jobs: export UID docker-compose -f docker-compose.dev.yml up --build -d docker exec -i buzzer_app id - docker exec -i buzzer_app composer install + docker exec -i -u root buzzer_app composer install # php artisan key:generate # php artisan migrate From be6f11f1f0fdad088cf181121f3155b6cfa338c4 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 15:36:24 +0200 Subject: [PATCH 11/21] BZR-62: add key, migrations --- .github/workflows/codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 17919eb..3e7c64e 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -21,7 +21,10 @@ jobs: docker-compose -f docker-compose.dev.yml up --build -d docker exec -i buzzer_app id docker exec -i -u root buzzer_app composer install + docker exec -i -u root buzzer_app php artisan key:generate + docker exec -i -u root buzzer_app php artisan migrate + # provare senza "export UID" e "docker exec -i buzzer_app id" # php artisan key:generate # php artisan migrate # - name: Upload coverage reports to Codecov From 1e650004629dce0f0fcf8b6d2865078e8f8e9f33 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Tue, 5 Sep 2023 15:45:29 +0200 Subject: [PATCH 12/21] BZR-62: add tests with coverage --- .github/workflows/codecov.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 3e7c64e..b6c0fe0 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -23,10 +23,9 @@ jobs: docker exec -i -u root buzzer_app composer install docker exec -i -u root buzzer_app php artisan key:generate docker exec -i -u root buzzer_app php artisan migrate + docker exec -i -u root buzzer_app vendor/bin/phpunit --coverage-html tmp/coverage # provare senza "export UID" e "docker exec -i buzzer_app id" - # php artisan key:generate - # php artisan migrate # - name: Upload coverage reports to Codecov # uses: codecov/codecov-action@v3 # env: From bbe4f56823754eb8cb1941a9a2d72a026e4dfd00 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 14:11:12 +0200 Subject: [PATCH 13/21] BZR-62: upload report --- .github/workflows/codecov.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index b6c0fe0..cd26b7a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -5,11 +5,11 @@ on: types: - opened branches: - - 'master' + - "master" push: branches: - - 'master' - - 'BZR-**' + - "master" + - "BZR-**" jobs: run-tests: runs-on: ubuntu-latest @@ -24,9 +24,9 @@ jobs: docker exec -i -u root buzzer_app php artisan key:generate docker exec -i -u root buzzer_app php artisan migrate docker exec -i -u root buzzer_app vendor/bin/phpunit --coverage-html tmp/coverage + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # provare senza "export UID" e "docker exec -i buzzer_app id" - # - name: Upload coverage reports to Codecov - # uses: codecov/codecov-action@v3 - # env: - # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From a471d13445d7ecac4f9557209240c132fb9fb124 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 14:48:46 +0200 Subject: [PATCH 14/21] BZR-62: add crypt key for testing purpose --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index e69b1cd..1974aca 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ APP_DEBUG=true APP_URL=http://localhost:8085 #must be a number of 16 figures -CRYPT_KEY= +CRYPT_KEY=1234567890123456 LOG_CHANNEL=logstash From fd9d2310f652074489b17cade5545a42fa80278a Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 15:10:20 +0200 Subject: [PATCH 15/21] BZR-62: generate xml report --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index cd26b7a..d66d147 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -23,7 +23,7 @@ jobs: docker exec -i -u root buzzer_app composer install docker exec -i -u root buzzer_app php artisan key:generate docker exec -i -u root buzzer_app php artisan migrate - docker exec -i -u root buzzer_app vendor/bin/phpunit --coverage-html tmp/coverage + docker exec -i -u root buzzer_app vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: From e4b7fb5853c179f36bd4af154ec57489e052e859 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 15:20:52 +0200 Subject: [PATCH 16/21] BZR-62: add codecov config file --- codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..34f4f4a --- /dev/null +++ b/codecov.yml @@ -0,0 +1,6 @@ +coverage: + status: + project: + default: + target: 75% + threshold: 1% From eeb17215c5374574c6e6d5bf525907fd84c3c4b6 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 15:42:17 +0200 Subject: [PATCH 17/21] BZR-62: add test coverage badge --- README.md | 107 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index fad4bbc..0873762 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,69 @@ -# About the project +[![codecov](https://codecov.io/gh/ZanichelliEditore/buzzer/graph/badge.svg?token=8SXK5GTU0I)](https://codecov.io/gh/ZanichelliEditore/buzzer) + +# About the project Buzzer is a Laravel app that establishes a mean of communication between different projects by leveraging the [publish/subscribe pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern). At the moment buzzer's authentication is setup to rely on Zanichelli's own IDP for authentication, but you can still test the app without authenticating. # Table of Contents -- [Setup](#setup) -- [GUI](#gui) -- [Usage](#usage) -- [Testing](#testing) -- [API Documentation](#api-documentation) -- [Logs](#logs) -- [Infrastructure as Code](#infrastructure-as-code) -- [How to contribute](#how-to-contribute) - + +- [Setup](#setup) +- [GUI](#gui) +- [Usage](#usage) +- [Testing](#testing) +- [API Documentation](#api-documentation) +- [Logs](#logs) +- [Infrastructure as Code](#infrastructure-as-code) +- [How to contribute](#how-to-contribute) + # Setup Please note that **steps 2 to 5** are **optional** (but recommended). Follow them if you want to use **Docker containers** for local development. -1. Git clone the repository into your folder. +1. Git clone the repository into your folder. `git clone git@github.com:ZanichelliEditore/buzzer.git` -2. Copy env.example to .env and fill the empty fields. - 1. If you want to try the app without authenticating, set `USE_ZANICHELLI_IDP=false` +2. Copy env.example to .env and fill the empty fields. -3. From the project's root folder, build Docker images with + 1. If you want to try the app without authenticating, set `USE_ZANICHELLI_IDP=false` + +3. From the project's root folder, build Docker images with `docker-compose -f docker-compose.dev.yml up --build -d` or `make rebuild` -4. You must run the next few commands _inside_ the app's container. To enter the container, use `make shell` or: +4. You must run the next few commands _inside_ the app's container. To enter the container, use `make shell` or: `docker exec -it buzzer_app bash` -5. Install the required dependencies with composer +5. Install the required dependencies with composer `composer install` -6. Generate a random application key +6. Generate a random application key `php artisan key:generate` -7. To aid with development, you can also publish telescope assets +7. To aid with development, you can also publish telescope assets `php artisan telescope:publish` -8. Launch migrations and seeders to create and populate the database tables +8. Launch migrations and seeders to create and populate the database tables `php artisan migrate --seed` -9. Exit the container shell with *ctrl+D* / *cmd+D* then run: +9. Exit the container shell with _ctrl+D_ / _cmd+D_ then run: - `make npm_install` - `make npm_run` - ## Accessing services -- **Web** the frontend admin app: http://localhost:8085 +- **Web** the frontend admin app: http://localhost:8085 -- **phpMyAdmin**: http://localhost:8086 +- **phpMyAdmin**: http://localhost:8086 -- **Telescope**: http://localhost:8085/telescope +- **Telescope**: http://localhost:8085/telescope ## Starting and stopping containers @@ -77,33 +80,40 @@ To off and remove container services, use `make down` or: `docker-compose -f docker-compose.dev.yml down` # GUI + The app consists of four main views ## Publishers + Here you can manage all the publishers authorized to use your app. To create a publisher you need to provide: -- a meaningful name -- the host from which the publisher will call buzzer -- a username for the basic auth protecting incoming calls - + +- a meaningful name +- the host from which the publisher will call buzzer +- a username for the basic auth protecting incoming calls + Once you create a publisher the app will provide you with a password for the basic auth. ## Subscribers Here you can manage all the subscribers buzzer can contact. To create a subscriber you need to provide: -- a menaningful name -- the host buzzer needs to call. + +- a menaningful name +- the host buzzer needs to call. Please note you only need to specify the host at this time, not the full endpoint. ## Channels + Here you can find and inspect all the configured channels. To create a channel you need to provide: -- a meaningful name -- the channel's priority. Buzzer will look at this value to determine in what order it needs to dispatch incoming messages. + +- a meaningful name +- the channel's priority. Buzzer will look at this value to determine in what order it needs to dispatch incoming messages. By hitting the edit button on an existing channel you can access and manage the full list of publishers and subscribers interacting with the channel. Here is where you can configure the exact endpoints for your subscribers. ## Failed Jobs + Here you'll find a list of all failed jobs, with an option to retry or delete them. You can do this both for single jobs or for all failed jobs at once. # Usage @@ -124,20 +134,20 @@ The following guide assumes you already completed the steps outlined in the [Set 5. We sent our message! 6. looking at the log file from step 3, notice how three logs have appeared. They're the result of a call to three different APIs. See the [#channels](#channels) section of the GUI for more information. - # Testing You can run tests using the PHPUnit binary located in the vendor directory -- Run every method of a specific test class - - `docker exec appContainerName vendor/bin/phpunit tests/Feature/TestClassName` or `make run_tests tests/Feature/TestClassName` +- Run every method of a specific test class + + - `docker exec appContainerName vendor/bin/phpunit tests/Feature/TestClassName` or `make run_tests tests/Feature/TestClassName` -- Run a single method of a specific test class - - `docker exec appContainerName vendor/bin/phpunit --filter testMethodName tests/Feature/TestClassName` or `make run_tests --filter testMethodName tests/Feature/TestClassName` +- Run a single method of a specific test class -- To generate the HTML code coverage report pass the following option: `--coverage-html tmp/coverage` - - `docker exec --coverage-html tmp/coverage appContainerName vendor/bin/phpunit tests/Feature/TestClassName` or `make run_coverage` + - `docker exec appContainerName vendor/bin/phpunit --filter testMethodName tests/Feature/TestClassName` or `make run_tests --filter testMethodName tests/Feature/TestClassName` +- To generate the HTML code coverage report pass the following option: `--coverage-html tmp/coverage` + - `docker exec --coverage-html tmp/coverage appContainerName vendor/bin/phpunit tests/Feature/TestClassName` or `make run_coverage` # API Documentation @@ -145,27 +155,31 @@ You can run tests using the PHPUnit binary located in the vendor directory This project uses Swagger-php to generate API documentation, following the OpenAPI specifications. -- Swagger-PHP reference: http://zircote.com/swagger-php/Getting-started.html +- Swagger-PHP reference: http://zircote.com/swagger-php/Getting-started.html -- OpenAPI specification: https://swagger.io/docs/specification/basic-structure/ +- OpenAPI specification: https://swagger.io/docs/specification/basic-structure/ ## View documentation Once you've built your containers, the swagger documentation is available at http://localhost:8085/api/documentation # Logs + Buzzer includes a filebeat instance that is set up to communicate with a logstash pipeline. If you or your organization have a running logstash instance, you can connect it by changing the `hosts` IP/port inside the .yml files in `docker/filebeat` # Infrastructure as Code + We use terraform, jenkins and ansible to manage our infrastructure on AWS via code. As terraform configurations were highly customized to address our specific needs, we decided to exclude them from the current repository to avoid unnecessary clutter. ## Jenkins + You need to add the following build parameters to your jenkins pipeline: -- `deploy_branch`: the branch you're deploying -- `aws_account`: the ID of your AWS account + +- `deploy_branch`: the branch you're deploying +- `aws_account`: the ID of your AWS account Our pipelines are configured to act on AWS through the `ContinuousIntegrationAccessRole` role on the provided account. You should set up a similar role or change the name inside the jenkinsfiles. @@ -174,8 +188,9 @@ Feel free to also change the region, which is currently setup as `eu-west-1`. # How to Contribute ## Did you find a bug? -* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/ZanichelliEditore/buzzer/issues). -* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/ZanichelliEditore/buzzer/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible and, wherever possible, a **code sample** demonstrating the expected behavior that is not occurring. +- **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/ZanichelliEditore/buzzer/issues). + +- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/ZanichelliEditore/buzzer/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible and, wherever possible, a **code sample** demonstrating the expected behavior that is not occurring. -* We expect all who interact with the project to follow the [Contributor Covenant Code of Conduct](https://github.com/ZanichelliEditore/buzzer/blob/master/CODE-OF-CONDUCT.md) +- We expect all who interact with the project to follow the [Contributor Covenant Code of Conduct](https://github.com/ZanichelliEditore/buzzer/blob/master/CODE-OF-CONDUCT.md) From 155a777dc63bd697d703cfd295b0521f1badf56a Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 15:58:43 +0200 Subject: [PATCH 18/21] BZR-62: refactor workflow steps --- .github/workflows/codecov.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index d66d147..6d8a424 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,7 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: | + - name: Init application + run: | cp .env.example .env export UID docker-compose -f docker-compose.dev.yml up --build -d @@ -23,7 +24,8 @@ jobs: docker exec -i -u root buzzer_app composer install docker exec -i -u root buzzer_app php artisan key:generate docker exec -i -u root buzzer_app php artisan migrate - docker exec -i -u root buzzer_app vendor/bin/phpunit --coverage-clover=coverage.xml + - name: Run tests and generate xml report + run: docker exec -i -u root buzzer_app vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: From 46bf892485e77212517576f0c2b7aab21d229001 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 16:04:29 +0200 Subject: [PATCH 19/21] BZR-62: remove id export and check --- .github/workflows/codecov.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 6d8a424..c939e64 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,9 +18,7 @@ jobs: - name: Init application run: | cp .env.example .env - export UID docker-compose -f docker-compose.dev.yml up --build -d - docker exec -i buzzer_app id docker exec -i -u root buzzer_app composer install docker exec -i -u root buzzer_app php artisan key:generate docker exec -i -u root buzzer_app php artisan migrate From 6b94609c45c784103646df02fc0dd678c8298ce3 Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 16:14:44 +0200 Subject: [PATCH 20/21] BZR-62: remove comment --- .github/workflows/codecov.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index c939e64..f86e016 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -9,7 +9,6 @@ on: push: branches: - "master" - - "BZR-**" jobs: run-tests: runs-on: ubuntu-latest @@ -28,5 +27,3 @@ jobs: uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - # provare senza "export UID" e "docker exec -i buzzer_app id" From 37fd972b0a419a36df9342e49bb99e2e2b05425e Mon Sep 17 00:00:00 2001 From: Francesco Santi Date: Thu, 7 Sep 2023 16:15:09 +0200 Subject: [PATCH 21/21] BZR-62: update basic config --- codecov.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codecov.yml b/codecov.yml index 34f4f4a..f7efe4b 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,5 +2,9 @@ coverage: status: project: default: + informational: true target: 75% threshold: 1% + patch: + default: + informational: true