forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (89 loc) · 2.9 KB
/
web.yml
File metadata and controls
108 lines (89 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Web
on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
dusk-php:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/tests/data/
!/tests/snmpsim/
!/mibs/
!/doc/
- name: Init env
run: |
cat > .env <<EOL
APP_KEY=
APP_URL=http://127.0.0.1:8000
APP_ENV=testing
APP_DEBUG=true
DB_HOST=127.0.0.1
DB_DATABASE=librenms_phpunit_78hunjuybybh
DB_USERNAME=root
DB_PASSWORD=root
DB_TEST_HOST=127.0.0.1
DB_TEST_DATABASE=librenms_phpunit_78hunjuybybh
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=root
MAIL_MAILER=log
EOL
- name: Create Database
run: |
sudo systemctl start mysql
mysql --user="root" --password="root" -e "CREATE DATABASE \`librenms_phpunit_78hunjuybybh\` character set UTF8mb4 collate utf8mb4_bin;"
- name: Setup SQLite
run: sqlite3 database/testing.sqlite ""
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-${{ secrets.CACHE_VERSION }}-
- name: Install Composer Dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Generate Application Key
run: php artisan key:generate
- name: Migrate Database
run: php artisan migrate --database=testing
- name: Upgrade Chrome Driver
run: php artisan dusk:chrome-driver --detect
- name: Start Chrome Driver
run: ./vendor/laravel/dusk/bin/chromedriver-linux --port=9515 &
- name: Run Laravel Server
run: php artisan serve --no-reload &
- name: Run Dusk Tests
run: php artisan dusk
- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v7
with:
name: screenshots
path: tests/Browser/screenshots
- name: Upload Console Logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: console
path: tests/Browser/console
- name: Upload LibreNMS Logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: librenms-logs
path: logs/librenms.log