-
Notifications
You must be signed in to change notification settings - Fork 69
97 lines (90 loc) · 3.42 KB
/
compatibility.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
name: Compatibility - WC, WP and PHP
on:
pull_request
env:
WC_MIN_SUPPORTED_VERSION: '7.6.0'
WP_MIN_SUPPORTED_VERSION: '6.0'
PHP_MIN_SUPPORTED_VERSION: '7.3'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
generate-wc-compat-matrix:
name: "Generate the matrix for woocommerce compatibility dynamically"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
- name: "Generate matrix"
id: generate_matrix
run: |
WC_VERSIONS=$( echo "[\"$WC_MIN_SUPPORTED_VERSION\", \"latest\", \"beta\"]" )
MATRIX_INCLUDE=$( echo "[{\"woocommerce\":\"$WC_MIN_SUPPORTED_VERSION\",\"wordpress\":\"$WP_MIN_SUPPORTED_VERSION\",\"gutenberg\":\"13.6.0\",\"php\":\"$PHP_MIN_SUPPORTED_VERSION\"}]" )
echo "matrix={\"woocommerce\":$WC_VERSIONS,\"wordpress\":[\"latest\"],\"gutenberg\":[\"latest\"],\"php\":[\"7.4\"], \"include\":$MATRIX_INCLUDE}" >> $GITHUB_OUTPUT
woocommerce-compatibility:
name: "WC compatibility"
needs: generate-wc-compat-matrix
runs-on: ubuntu-latest
env:
WP_VERSION: ${{ matrix.wordpress }}
WC_VERSION: ${{ matrix.woocommerce }}
GUTENBERG_VERSION: ${{ matrix.gutenberg }}
strategy:
fail-fast: false
max-parallel: 10
matrix: ${{ fromJSON(needs.generate-wc-compat-matrix.outputs.matrix) }}
steps:
# clone the repository
- uses: actions/checkout@v3
# enable dependencies caching
- uses: actions/cache@v3
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: none
# run CI checks
- run: bash bin/run-ci-tests.bash
generate-wc-compat-beta-matrix:
name: "Generate the matrix for compatibility-woocommerce-beta dynamically"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
- name: "Generate matrix"
id: generate_matrix
run: |
PHP_VERSIONS=$( echo "[\"$PHP_MIN_SUPPORTED_VERSION\", \"8.0\", \"8.1\"]" )
echo "matrix={\"woocommerce\":[\"beta\"],\"wordpress\":[\"latest\"],\"gutenberg\":[\"latest\"],\"php\":$PHP_VERSIONS}" >> $GITHUB_OUTPUT
# a dedicated job, as allowed to fail
compatibility-woocommerce-beta:
name: Environment - WC beta
needs: generate-wc-compat-beta-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.generate-wc-compat-beta-matrix.outputs.matrix) }}
env:
WP_VERSION: ${{ matrix.wordpress }}
WC_VERSION: ${{ matrix.woocommerce }}
GUTENBERG_VERSION: ${{ matrix.gutenberg }}
steps:
# clone the repository
- uses: actions/checkout@v3
# enable dependencies caching
- uses: actions/cache@v3
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: none
# run CI checks
- run: bash bin/run-ci-tests.bash