-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (68 loc) · 2.41 KB
/
validation_cron.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
name: Validation on Schedule
on:
workflow_dispatch:
schedule:
# Run every week on Monday at 8AM IST.
- cron: '30 2 * * MON'
defaults:
run:
shell: bash
jobs:
full:
name: Validation
runs-on: ubuntu-latest
env:
CI: GITHUB_ACTIONS
MYSQL_ROOT_PASSWORD: root
MYSQL_USER_NAME: drupal
MYSQL_USER_PASSWORD: drupal
MYSQL_DATABASE_NAME: drupal
MYSQL_HOST: database
steps:
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 database" | sudo tee -a /etc/hosts
- name: Prepare environment variables
run: |
echo "GITHUB_REF_NAME=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
echo "COMPOSER_BIN=$(echo ${GITHUB_WORKSPACE}/vendor/bin)" >> $GITHUB_ENV
echo "BLT_DIR=$(echo ${GITHUB_WORKSPACE}/vendor/acquia/blt)" >> $GITHUB_ENV
echo "SCRIPT_DIR=$(echo ${GITHUB_WORKSPACE}/blt/scripts/github-actions)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
- name: Run Composer install
run: |
composer validate --no-check-all --ansi
composer install --no-interaction || composer install --no-interaction || composer install --no-interaction
- name: Cache dependencies installed with Composer
id: composer-cache
run: |
echo dir=$(composer config cache-files-dir) >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: |
"${{ steps.composer-cache.outputs.dir }}"
~/.drush/cache
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
- name: Prepare bin executables
run: |
ln -s ${GITHUB_WORKSPACE}/vendor/acquia/blt/bin/blt /usr/local/bin/blt
ln -s ${GITHUB_WORKSPACE}/vendor/drush/drush/drush /usr/local/bin/drush
- name: Setup environment
run: |
sudo systemctl start mysql.service
bash ${SCRIPT_DIR}/setup_env.sh
- name: Setup app
run: bash ${SCRIPT_DIR}/setup_app.sh
- name: Test Security
run: bash ${SCRIPT_DIR}/test_security.sh
- name: Setup ChromeDriver
uses: nanasess/setup-chromedriver@v1
- name: Run ChromeDriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
- name: Test Behat
run: bash ${SCRIPT_DIR}/test_behat.sh
- name: Test PA11Y
run: bash ${SCRIPT_DIR}/test_pa11y.sh