Skip to content

Commit 6eb6a16

Browse files
committed
Enable CI
1 parent 8bc6d7d commit 6eb6a16

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.gitattributes export-ignore
2+
/.github export-ignore
23
/.gitignore export-ignore
34
/package.xml export-ignore
45
/docs export-ignore
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
tests:
11+
runs-on: ${{ matrix.operating-system }}
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
operating-system: ['ubuntu-latest']
17+
php-version: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
18+
19+
name: CI on ${{ matrix.operating-system }} with PHP ${{ matrix.php-version }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
tools: composer:v2
30+
coverage: none
31+
32+
- name: Get Composer Cache Directory
33+
id: composer-cache
34+
run: |
35+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
36+
37+
- name: Cache dependencies
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ steps.composer-cache.outputs.dir }}
41+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
42+
restore-keys: |
43+
${{ runner.os }}-composer-
44+
45+
- name: Install dependencies with Composer
46+
run: |
47+
composer update --no-interaction --prefer-dist --no-progress ${{ matrix.composer-flags }}
48+
49+
- name: Run PHPUnit for Composer install
50+
run: |
51+
vendor/bin/phpunit tests
52+
53+
- name: Install PEAR
54+
run: |
55+
sudo apt-get install php-pear
56+
57+
- name: Install package with PEAR
58+
run: |
59+
pear package-validate ./package.xml
60+
php ./pear-package-helper.php
61+
sudo pear install ./.pear-package/package.xml
62+
63+
- name: Run PHPUnit for PEAR install
64+
run: |
65+
cd `pear config-get test_dir`
66+
${GITHUB_WORKSPACE}/vendor/bin/phpunit ./HTML_Template_Sigma

0 commit comments

Comments
 (0)