-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (96 loc) · 2.72 KB
/
shell.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
name: Shell
on:
pull_request:
branches:
- main
paths:
- .github/workflows/shell.yml
- "bin/**"
- "cfg/**"
env:
COMPOSER_CACHE_DIR: ~/.composer/cache
TERM: xterm-256color
jobs:
format:
name: Check format
uses: es-progress/.github/.github/workflows/beautysh.yml@main
with:
dir: bin/
linter:
name: Linting
needs: format
uses: es-progress/.github/.github/workflows/shellcheck.yml@main
with:
dir: bin/
test-ci:
name: Test CI mode
runs-on: ubuntu-20.04
needs:
- format
- linter
steps:
- name: Self checkout
uses: actions/checkout@v4
- name: Cache composer
uses: actions/cache@v4
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: composer-${{ hashFiles('composer.lock') }}
- name: Setup environment
run: ./bin/prepare.sh
- name: Install CiviCRM
run: ./bin/install.sh .
- name: Get model extension (rc-base)
uses: actions/checkout@v4
with:
repository: reflexive-communications/rc-base
path: rc-base
- name: Install extension
run: ./bin/extension.sh . rc-base
- name: Run extension unit tests
run: ./bin/tests.sh . rc-base --filter DBTest
test-dev:
name: Test Dev mode
runs-on: ubuntu-20.04
needs:
- format
- linter
steps:
- name: Self checkout
uses: actions/checkout@v4
- name: Cache composer
uses: actions/cache@v4
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: composer-${{ hashFiles('composer.lock') }}
- name: Get model extension (rc-base)
uses: actions/checkout@v4
with:
repository: reflexive-communications/rc-base
path: rc-base
- name: Set local config
run: |
cp cfg/install.cfg cfg/install.local.cfg
sed -ri \
-e 's@^(civi_db_user_name)=.*$@\1=db_admin@' \
-e 's@^(civi_db_user_pass)=.*$@\1=admin@' \
-e 's@^(civi_domain)=.*$@\1=civi.local.com@' \
cfg/install.local.cfg
- name: Setup environment
run: ./bin/prepare.sh
- name: Install CiviCRM
run: ./bin/install.sh . --sample
- name: Install extension
run: ./bin/extension.sh . rc-base
- name: Config CiviCRM
run: ./bin/dev-config.sh
- name: Init test DB
run: ./bin/init-test-DB.sh
- name: Run extension unit tests
run: ./bin/tests.sh . rc-base --filter DBTest
- name: Clear cache
run: ./bin/clear-cache.sh
- name: Set permissions
run: ./bin/set-perm.sh
- name: Reinstall CiviCRM
run: ./bin/reinstall.sh . --sample