Skip to content

Commit 8d08182

Browse files
authored
[Chore] Refactor tests workflow (alexjustesen#1054)
1 parent a510010 commit 8d08182

File tree

7 files changed

+97
-71
lines changed

7 files changed

+97
-71
lines changed

.env.example

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ APP_KEY=
44
APP_DEBUG=false
55
APP_URL=http://localhost
66

7-
FORCE_HTTPS=false
8-
9-
CONTENT_WIDTH=7xl
10-
11-
DASHBOARD_POLLING=60
12-
NOTIFICATION_POLLING=60
13-
RESULTS_POLLING=false
14-
157
LOG_CHANNEL=stack
168
LOG_DEPRECATIONS_CHANNEL=null
179
LOG_LEVEL=debug
@@ -39,10 +31,4 @@ MAIL_ENCRYPTION=null
3931
MAIL_FROM_ADDRESS="[email protected]"
4032
MAIL_FROM_NAME="Speedtest Tracker"
4133

42-
AWS_ACCESS_KEY_ID=
43-
AWS_SECRET_ACCESS_KEY=
44-
AWS_DEFAULT_REGION=us-east-1
45-
AWS_BUCKET=
46-
AWS_USE_PATH_STYLE_ENDPOINT=false
47-
4834
TELEGRAM_BOT_TOKEN=null

.env.testing

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
APP_NAME="Speedtest Tracker"
2+
APP_ENV=local
3+
APP_KEY=base64:Tx3xYzxoL/5LmKHYr9QXlbnhTDVE1GK5T7tzxpovHaY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
LOG_DEPRECATIONS_CHANNEL=null
9+
LOG_LEVEL=debug
10+
11+
DB_CONNECTION=mysql
12+
DB_HOST=127.0.0.1
13+
DB_PORT=3306
14+
DB_DATABASE=testing
15+
DB_USERNAME=root
16+
DB_PASSWORD=
17+
18+
BROADCAST_DRIVER=log
19+
CACHE_DRIVER=file
20+
FILESYSTEM_DISK=local
21+
QUEUE_CONNECTION=database
22+
SESSION_DRIVER=database
23+
SESSION_LIFETIME=1440
24+
25+
MAIL_MAILER=smtp
26+
MAIL_HOST=mailhog
27+
MAIL_PORT=1025
28+
MAIL_USERNAME=null
29+
MAIL_PASSWORD=null
30+
MAIL_ENCRYPTION=null
31+
MAIL_FROM_ADDRESS="[email protected]"
32+
MAIL_FROM_NAME="Speedtest Tracker"
33+
34+
TELEGRAM_BOT_TOKEN=null

.github/dependabot.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,24 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
day: "thursday"
78
labels:
89
- "😑 dependencies"
910
- "🐋 docker"
11+
reviewers:
12+
- "alexjustesen"
13+
commit-message:
14+
prefix: "docker"
15+
1016
- package-ecosystem: "github-actions"
1117
directory: "/"
1218
schedule:
1319
interval: "weekly"
20+
day: "thursday"
1421
labels:
1522
- "😑 dependencies"
1623
- "🧑‍💻 github actions"
17-
# - package-ecosystem: "composer"
18-
# directory: "/"
19-
# schedule:
20-
# interval: "weekly"
21-
# labels:
22-
# - "😑 dependencies"
23-
# - "🐘 php"
24+
reviewers:
25+
- "alexjustesen"
26+
commit-message:
27+
prefix: "gh actions"

.github/workflows/lint.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,88 @@
1-
name: Test
1+
# .github/workflows/tests.yml
2+
name: Tests
23

34
on:
45
push:
56
branches:
67
- '!main'
78
- '!release-**'
9+
pull_request:
810
workflow_dispatch:
911

1012
jobs:
13+
lint:
14+
runs-on: ubuntu-22.04
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: "duster"
19+
uses: tighten/duster-action@v2
20+
with:
21+
args: lint --using=pint
22+
1123
test:
12-
strategy:
13-
matrix:
14-
operating-system:
15-
- ubuntu-latest
16-
php-version:
17-
- '8.2'
18-
name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }}
24+
needs: [lint] # needs lint job to pass first
25+
26+
runs-on: ubuntu-22.04
27+
1928
services:
2029
mysql:
2130
image: mysql:8.0
2231
env:
2332
MYSQL_ALLOW_EMPTY_PASSWORD: yes
24-
MYSQL_DATABASE: test
33+
MYSQL_DATABASE: testing
2534
ports:
2635
- 3306:3306
2736
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
28-
runs-on: ${{ matrix.operating-system }}
37+
2938
steps:
3039
- name: Checkout
3140
uses: actions/checkout@v3
41+
3242
- name: Setup PHP
3343
uses: shivammathur/setup-php@v2
3444
with:
35-
php-version: ${{ matrix.php-version }}
36-
extensions: bcmath, ctype, fileinfo, json, mbstring, openssl, pdo, tokenizer, xml
37-
coverage: xdebug
45+
php-version: '8.2'
46+
3847
- name: Prepare the environment
39-
run: cp .env.example .env
48+
run: cp .env.testing .env
49+
4050
- name: Get composer cache directory
4151
id: composer-cache
4252
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
53+
4354
- name: Setup composer cache
4455
uses: actions/cache@v3
4556
with:
4657
path: ${{ steps.composer-cache.outputs.dir }}
4758
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
4859
restore-keys: ${{ runner.os }}-composer-
60+
4961
- name: Install composer dependencies
50-
env:
51-
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
52-
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
53-
- name: Install application
62+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
63+
64+
- name: Install npm dependencies and build assets
65+
run: npm ci && npm run build
66+
67+
- name: Directory permissions
68+
run: chmod -R 777 storage bootstrap/cache
69+
70+
- name: Test application install
5471
run: php artisan app:install --force
5572
env:
5673
DB_CONNECTION: mysql
5774
DB_HOST: 127.0.0.1
5875
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
76+
DB_DATABASE: testing
5977
DB_USERNAME: root
60-
DB_DATABASE: test
6178
DB_PASSWORD: null
79+
6280
- name: Run tests
6381
run: php artisan test
6482
env:
6583
DB_CONNECTION: mysql
6684
DB_HOST: 127.0.0.1
6785
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
86+
DB_DATABASE: testing
6887
DB_USERNAME: root
69-
DB_DATABASE: test
7088
DB_PASSWORD: null

composer.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pint.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"exclude": [
44
"config"
55
],
6-
"notName": [
7-
"server.php"
8-
]
6+
"rules": {
7+
"fully_qualified_strict_types": false
8+
}
99
}

0 commit comments

Comments
 (0)