-
Notifications
You must be signed in to change notification settings - Fork 518
116 lines (89 loc) · 3.01 KB
/
build.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
109
110
111
112
113
114
115
116
name: Build
on: [push, pull_request]
jobs:
backend:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1, 8.2]
steps:
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate --strict --no-check-version
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run unit test suite
run: composer run-script unit
- name: Validate coding standards
run: composer run-script cs
- name: Run linters
run: composer run-script lint
- name: Run static analysis
run: composer run-script stan
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: '16'
- name: Install frontend dependencies
run: npm install
- name: Run frontend test suite
run: npm test
acceptance:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: '16'
- name: Install dependencies
run: composer install --prefer-dist --no-progress && npm install
- name: Build frontend assets
run: npm run build
- name: Run application server
run: echo 'deb [trusted=yes] https://repo.symfony.com/apt/ /' | sudo tee /etc/apt/sources.list.d/symfony-cli.list && sudo apt update && sudo apt install symfony-cli && APP_ENV=prod DEFAULT_REPOSITORY_DIR=${{ github.workspace }}/tests/fixtures symfony server:start --port=8880 -d
- name: Run Cypress acceptance tests
uses: cypress-io/github-action@v2
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [backend, frontend]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: '16'
- name: Install frontend dependencies
run: npm install
- name: Build package
run: make build
- name: Rename package to current tag
run: mv build.zip gitlist-${{ github.ref_name }}.zip
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: gitlist-${{ github.ref_name }}.zip