Repository navigation
70 lines (57 loc) · 2.07 KB
/
Copy pathwordpress.yaml
File metadata and controls
70 lines (57 loc) · 2.07 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
name: WordPress
on:
pull_request:
branches:
- main
paths:
- wordpress/**
- scripts/publish-wordpress-svn.sh
- .github/workflows/wordpress.yaml
jobs:
test:
name: Plugin on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
matrix:
# 5.6 is the plugin's "Requires PHP" floor (wordpress/svn/trunk/README.txt).
php: ["5.6", "8.3"]
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Lint the plugin
run: |
for file in wordpress/svn/trunk/*.php; do
docker run --rm -v "$PWD":/w php:${{ matrix.php }}-cli php -l "/w/$file"
done
- name: Test the PDF link rule against the shared cases
run: docker run --rm -v "$PWD":/w php:${{ matrix.php }}-cli php /w/wordpress/tests/pdf-links-test.php
vendored-bundle:
name: Vendored web-embed matches the pinned version
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Re-vendor from npm and compare
working-directory: wordpress
run: |
npm ci
npm run copy-src
npm run copy-build
npm run copy-fixtures
git diff --exit-code -- svn/trunk/src svn/trunk/build tests/fixtures
test -z "$(git status --porcelain -- svn/trunk/src svn/trunk/build tests/fixtures)"
- name: The plugin enqueues the pinned version
working-directory: wordpress
run: |
pinned_version=$(node -p "require('./package.json').dependencies['@simplepdf/web-embed-pdf']")
grep -q "define('SIMPLEPDF_WEB_EMBED_VERSION', '${pinned_version}');" svn/trunk/simplepdf-embed.php
publish-preview:
name: WordPress.org publish preview (dry run)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install Subversion
run: sudo apt-get update -qq && sudo apt-get install -y -qq subversion
- name: What merging this sends to WordPress.org
run: DRY_RUN=1 scripts/publish-wordpress-svn.sh