-
Notifications
You must be signed in to change notification settings - Fork 4
96 lines (81 loc) · 2.17 KB
/
ci.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
name: Continuous Integration
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch: ~
jobs:
sonarcloud:
name: SonarQube Cloud
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
lint:
name: Lint code
runs-on: ubuntu-22.04
defaults:
run:
working-directory: .
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
show-progress: false
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
tools: composer:v2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Lint code
run: composer phpcs
test:
name: Run tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
# We are using only the latest supported version as a first step
matrix:
include:
- wc_version: "8.2.2"
wp_version: "6.4.1"
php_version: "7.4"
env:
PHP_VERSION: ${{ matrix.php_version }}
WC_VERSION: ${{ matrix.wc_version }}
WP_VERSION: ${{ matrix.wp_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
show-progress: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build test container
uses: docker/bake-action@v5
with:
files: compose.yml
load: true
targets: test
set: |
test.cache-from=type=gha
test.cache-to=type=gha
- name: Run tests
run: docker compose run test