Skip to content

Commit

Permalink
Merge pull request #22 from nspalo/feature/BWA-8-weather-app-github-a…
Browse files Browse the repository at this point in the history
…ction

feature/BWA-8-weather-app-github-action
  • Loading branch information
nspalo authored Sep 11, 2023
2 parents 755b99b + 14d697a commit 0dfae7d
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 55 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/weather-app-ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Weather App CI

on:
push:
branches: [ "master", "development" ]
pull_request:
branches: [ "master", "development" ]

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Docker Login
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_KEY: ${{ secrets.DOCKER_KEY }}
run: |
docker login -u $DOCKER_USER -p $DOCKER_KEY
# Script Permissions
- name: Add Permission to Shell Scripts
run: chmod +x -R ./scripts/*.sh

# Docker Images
- name: Building the Docker Images
run: ./scripts/build.sh

# Docker Containers
- name: Start Docker Containers
run: ./scripts/up.sh -d

# Composer
- name: Run Composer
run: |
./scripts/composer.sh install
./scripts/composer.sh dump-autoload
# NPM
- name: Run NPM
run: |
./scripts/run.sh npm install
./scripts/run.sh npm run build
# Code Quality Check
- name: Run PhpStan
run: ./scripts/composer.sh run phpstan

- name: Run Easy Coding Sandards
run: ./scripts/composer.sh run ecs-all

- name: Run Automated Test with PhpUnit
run: ./scripts/composer.sh run phpunit

# Teardown
- name: Stop container and remove images
run: ./scripts/down.sh -v



1 change: 1 addition & 0 deletions src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"scripts": {
"post-autoload-dump": [
"mkdir -p ./bootstrap/cache/",
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
Expand Down
4 changes: 2 additions & 2 deletions src/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'max_output' => env('OPEN_WEATHER_MAX_OUTPUT', '5'),
'unit' => env('OPEN_WEATHER_UNIT', 'metric'),
'lang' => env('OPEN_WEATHER_LANG', 'en'),
'uri' => env('OPEN_WEATHER_API_URI', ''),
'uri' => env('OPEN_WEATHER_API_URI', 'api.openweathermap.org/data/2.5'),
],
'geoapify' => [
'filter' => env('GEOAPIFY_FILTER', 'countrycode:jp'),
Expand All @@ -46,7 +46,7 @@
'lang' => env('GEOAPIFY_LANG', 'en'),
'max_output' => env('GEOAPIFY_MAX_OUTPUT', '1'),
'type' => env('GEOAPIFY_TYPE', 'city'),
'uri' => env('GEOAPIFY_API_URI', ''),
'uri' => env('GEOAPIFY_API_URI', 'api.geoapify.com/v1/geocode/search'),
'default_search' => env('GEOAPIFY_DEFAULT', 'Tokyo, Japan'),
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Unit;
namespace Tests;

use Illuminate\Contracts\Console\Kernel;

Expand All @@ -15,7 +15,7 @@ trait CreatesApplication
*/
public function createApplication()
{
$app = require __DIR__ . '/../../bootstrap/app.php';
$app = require __DIR__ . '/../bootstrap/app.php';

$app->make(Kernel::class)->bootstrap();

Expand Down
23 changes: 0 additions & 23 deletions src/tests/Feature/ExampleTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/tests/Unit/TestCase.php → src/tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Unit;
namespace Tests;

use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

Expand Down
2 changes: 1 addition & 1 deletion src/tests/Unit/Enums/DirectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Unit\Enums;

use App\Enums\Direction;
use Unit\TestCase;
use Tests\TestCase;

class DirectionTest extends TestCase
{
Expand Down
20 changes: 0 additions & 20 deletions src/tests/Unit/ExampleTest.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use App\Services\ConfigurationMapper\Exceptions\UnknownServiceConfigurationException;
use App\Services\ConfigurationMapper\ServiceConfigurationMapper;
use Unit\TestCase;
use Tests\TestCase;

class ServiceConfigurationMapperTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use App\Services\UrlQueryStringBuilder\Interfaces\UrlQueryStringBuilderServiceInterface;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Facades\Http;
use Unit\TestCase;
use Tests\TestCase;

class GeocodingServiceTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Unit\Services\GeoapifyApi\Resources;

use App\Services\GeoapifyApi\Resources\GeolocationResource;
use Unit\TestCase;
use Tests\TestCase;

class GeolocationResourceTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Unit\Services\OpenWeatherApi\Resources;

use App\Services\OpenWeatherApi\Resources\WeatherResource;
use Unit\TestCase;
use Tests\TestCase;

class WeatherResourceTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Unit\Services\OpenWeatherApi\Resources;

use App\Services\OpenWeatherApi\Resources\WeatherResources;
use Unit\TestCase;
use Tests\TestCase;

class WeatherResourcesTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Unit\Services\UrlQueryStringBuilder;

use App\Services\UrlQueryStringBuilder\UrlQueryStringBuilderService;
use Unit\TestCase;
use Tests\TestCase;

class UrlQueryStringBuilderServiceTest extends TestCase
{
Expand Down

0 comments on commit 0dfae7d

Please sign in to comment.