-
Notifications
You must be signed in to change notification settings - Fork 1
108 lines (86 loc) · 2.58 KB
/
frontend.yml
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: Laravel Frontend Build and Test
on:
push:
branches: [master, staging, dev]
pull_request:
branches: [master, staging, dev]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, json, mbstring, pdo
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "22.7.0"
- name: Install specific npm version
run: npm install -g npm@10.8.2
- name: Cache node_modules and composer dependencies
uses: actions/cache@v4
with:
path: |
'**/node_modules'
'**/vendor'
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install NPM dependencies
run: npm ci
build:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "22.7.0"
- name: Restore npm packages
uses: actions/cache@v4
with:
path: |
'**/node_modules'
'**/vendor'
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install NPM dependencies
run: npm ci
- name: Build assets
run: npm run build
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: build-assets
path: public/build/**
- name: Output Node.js and npm versions
run: |
node --version
npm --version
- name: List build output
run: ls -R public/build
test:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "22.7.0"
- name: Restore npm packages
uses: actions/cache@v4
with:
path: |
'**/node_modules'
'**/vendor'
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install NPM dependencies
run: npm ci
- name: Run tests
run: npm run test:pipeline