Repository navigation
80 lines (75 loc) · 2.04 KB
/
Copy pathci.yml
File metadata and controls
80 lines (75 loc) · 2.04 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
name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
jobs:
php:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: sodium
tools: composer:v2
- run: composer install --no-interaction --no-progress
- run: vendor/bin/phpunit --testsuite unit
- if: matrix.php == '8.3'
run: composer lint
js:
name: JS build, lint & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: package-lock.json
- run: npm ci --no-audit --no-fund
- run: npm run lint
- run: npm run test:unit
- run: npm run build
- name: Release ZIP
run: bash bin/zip.sh
- uses: actions/upload-artifact@v4
with:
name: videooptimizer
path: dist/videooptimizer.zip
plugin-check:
name: Plugin Check
needs: js
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: videooptimizer
path: ${{ runner.temp }}
- run: unzip -q "${{ runner.temp }}/videooptimizer.zip" -d "${{ runner.temp }}/plugin"
- uses: wordpress/plugin-check-action@v1
with:
build-dir: ${{ runner.temp }}/plugin/videooptimizer
exclude-checks: plugin_updater
release:
name: GitHub release
if: startsWith(github.ref, 'refs/tags/v')
needs: [php, js, plugin-check]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: videooptimizer
path: dist
- uses: softprops/action-gh-release@v2
with:
files: dist/videooptimizer.zip
generate_release_notes: true