-
Notifications
You must be signed in to change notification settings - Fork 31
89 lines (78 loc) · 2.39 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
name: Build and Test SynchWeb
on:
push:
branches:
- 'master'
- 'prerelease'
- 'release/**'
- 'pre-release/**'
pull_request:
branches:
- 'master'
- 'prerelease'
- 'release/**'
- 'pre-release/**'
defaults:
run:
shell: bash
working-directory: ./api
# Note, jobs do not share the same working environment, whereas steps do. Also, jobs will run in parallel unless the 'needs' tag is used to flag a dependency
jobs:
php-build:
name: Checkout, build, test and lint PHP code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP 7.3
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
tools: psalm:4
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: PHPUnit Tests
uses: php-actions/phpunit@v3
env:
XDEBUG_MODE: coverage
with:
bootstrap: api/vendor/autoload.php
configuration: api/tests/phpunit.xml
php_extensions: xdebug mysqli zip
args: --coverage-text
php_version: 7.3
version: 9
- name: Run Psalm
run: psalm --output-format=github
js_build:
name: JavaScript build, test and lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: JavaScript build, lint and test
working-directory: ./client
# hack the output from the linting steps to avoid these stopping the builds - we are not going to get
# to a clean output without considerable effort, but it's useful to see the output
run: |
cp src/js/config_sample.json src/js/config.json
node --version
npm ci
npm run build
npm run test
npm run lint || exit 0
npm run lint-vue || exit 0