-
Notifications
You must be signed in to change notification settings - Fork 130
164 lines (164 loc) · 6.47 KB
/
codeigniter.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# GitHub Action for CodeIgniter
name: Testing Kalkun
on:
push:
branches:
- master
- devel
- 'release-**'
- 'feature-**'
pull_request:
branches: [ master, devel ]
jobs:
test:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, curl, dom
coverage: xdebug #optional
- name: Setup MySQL
uses: mirromutth/[email protected]
with:
character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
mysql version: '5.7' # Optional, default value is "latest". The version of the MySQL
mysql database: 'kalkun' # Optional, default value is "test". The specified database which will be create
mysql root password: password # Required if "mysql user" is empty, default is empty. The root superuser password
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer update
composer install --no-progress --prefer-dist --optimize-autoloader
- name: Verify mysql connection
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do
sleep 1
done
- name: Download Gammu DB Schema
uses: wei/wget@v1
with:
args: -O gammu.sql https://raw.githubusercontent.com/gammu/gammu/master/docs/sql/mysql.sql
- name: Import Gammu DB Schema
run: mysql -h"127.0.0.1" -P"3306" -uroot -ppassword kalkun < gammu.sql
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text -c application/tests
check-code:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, curl, dom
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer update
composer install --no-progress --prefer-dist --optimize-autoloader
sudo apt-get update
# html-beautify from the debian package doesn't work for some reason
# sudo apt-get install -y node-js-beautify
# Install npm and install js-beautify from there
sudo apt-get install -y npm
sudo npm update --verbose -g npm
sudo npm install --verbose -g js-beautify
- id: check_strict_comparison
name: Check that strict comparison operators are used everywhere
run: |
git checkout composer.lock
git status
utils/fix_code_style.sh strict
- id: check_style
name: Check that code follows Guidelines
if: always()
run: |
git checkout composer.lock
git status
utils/fix_code_style.sh git-diff
- name: Archive artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: Code style issues to fix
path: 'code_style_check*'
if-no-files-found: ignore
check-translation:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2']
runs-on: ${{ matrix.operating-system }}
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, curl, dom
coverage: xdebug #optional
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer update
composer install --no-progress --prefer-dist --optimize-autoloader
- id: translation
name: Check translations
run: |
mkfifo pipe
tee translation_check_output.txt < pipe &
./utils/check_translation.php all > pipe
- name: Archive artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: Translation check output
path: 'translation_check_output.*'
if-no-files-found: ignore