Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Commit 924c59f

Browse files
committed
Add github actions
Fix github action matrix Only lint for single drupal / php combo
1 parent 35f8ed3 commit 924c59f

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

.github/workflows/main.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Lint & Test
2+
3+
on:
4+
- push
5+
- pull_request
6+
- pull_request_target
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
lint:
12+
name: Lint
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
include:
17+
- drupal: "10"
18+
php: "8.2"
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: Cache Composer dependencies
23+
uses: actions/cache@v3
24+
with:
25+
path: |
26+
/tmp/composer-cache
27+
./web
28+
./vendor
29+
./composer.spoons.json
30+
./composer.spoons.lock
31+
key: ${{ runner.os }}-${{ hashFiles('**/composer.json') }}-php${{ matrix.php }}-drupal${{ matrix.drupal }}
32+
33+
- name: Install drupal
34+
uses: wunderwerkio/github-action-composer@v1-beta
35+
with:
36+
php_version: ${{ matrix.php }}
37+
setup_drupal: yes
38+
drupal_core_constraint: "^${{ matrix.drupal }}"
39+
40+
- name: Lint
41+
uses: wunderwerkio/github-action-composer@v1-beta
42+
with:
43+
php_version: ${{ matrix.php }}
44+
command: phpcs
45+
test:
46+
name: Test
47+
runs-on: ubuntu-latest
48+
strategy:
49+
matrix:
50+
include:
51+
- drupal: "9"
52+
php: "8.0"
53+
- drupal: "9"
54+
php: "8.1"
55+
- drupal: "10"
56+
php: "8.1"
57+
- drupal: "10"
58+
php: "8.2"
59+
steps:
60+
- uses: actions/checkout@v3
61+
62+
- name: Cache Composer dependencies
63+
uses: actions/cache@v3
64+
with:
65+
path: |
66+
/tmp/composer-cache
67+
./web
68+
./vendor
69+
./composer.spoons.json
70+
./composer.spoons.lock
71+
key: ${{ runner.os }}-${{ hashFiles('**/composer.json') }}-php${{ matrix.php }}-drupal${{ matrix.drupal }}
72+
73+
- name: Install drupal
74+
uses: wunderwerkio/github-action-composer@v1-beta
75+
with:
76+
php_version: ${{ matrix.php }}
77+
setup_drupal: yes
78+
drupal_core_constraint: "^${{ matrix.drupal }}"
79+
80+
- name: Test
81+
uses: wunderwerkio/github-action-composer@v1-beta
82+
with:
83+
php_version: ${{ matrix.php }}
84+
command: unit

0 commit comments

Comments
 (0)