-
Notifications
You must be signed in to change notification settings - Fork 53
167 lines (134 loc) · 6.58 KB
/
Copy pathintegration-test.yml
File metadata and controls
167 lines (134 loc) · 6.58 KB
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
165
166
167
name: Run integration test
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set TERM environment variable
run: echo "TERM=xterm-256color" >> $GITHUB_ENV
- name: Set git email
run: git config --global user.email "mjordan@sfu.ca"
- name: Set git name
run: git config --global user.name "Mark Jordan"
- name: Checkout workbench
uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: 3.11
- name: Checkout isle-site-template
uses: actions/checkout@v6
with:
repository: Islandora-Devops/isle-site-template
path: isle-site-template
- name: Install mkcert
run: |-
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert
- name: Start islandora-starter-site
shell: 'bash'
working-directory: isle-site-template
env:
ISLANDORA_TAG: main
ISLANDORA_STARTER_REF: "heads/main"
ISLANDORA_STARTER_OWNER: "Islandora-Devops"
GITHUB_ACTIONS: "true"
TERM: "xterm-256color"
run: |
make overwrite-starter-site init up \
ISLANDORA_TAG="main" \
ISLANDORA_STARTER_REF="heads/main" \
ISLANDORA_STARTER_OWNER="Islandora-Devops" \
GITHUB_ACTIONS="true" \
TERM="xterm-256color"
- name: Test switching frontend to TLS
working-directory: isle-site-template
run: ./scripts/traefik-https-mkcert.sh
- name: Restart Traefik to apply TLS changes
working-directory: isle-site-template
run: docker compose down traefik && docker compose up -d traefik
- name: make sure traefik is serving traffic
shell: 'bash'
working-directory: isle-site-template
run: ./scripts/ping.sh
env:
TERM: xterm-256color
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
# disable media standalone URL
docker exec isle-site-template-drupal-1 drush config:set media.settings standalone_url FALSE -y
docker exec isle-site-template-drupal-1 drush cr
- name: Install migrations
run: docker exec isle-site-template-drupal-1 drush migrate:import --userid=1 --tag=islandora -y
- name: Update file media type to allow jpg extension
run: |
EXTS=$(docker exec isle-site-template-drupal-1 drush config:get field.field.media.file.field_media_file settings.file_extensions | sed -E "s/.*: '(.*)'/\1/")
if echo "$EXTS" | grep -qw "jpg"; then
echo "jpg already present"
else
NEW_EXTS="$EXTS jpg"
echo "Updating extensions to: $NEW_EXTS"
docker exec isle-site-template-drupal-1 drush config:set field.field.media.file.field_media_file settings.file_extensions "$NEW_EXTS" -y
fi
- name: Reinstall islandora_workbench_integration views
run: |
docker exec isle-site-template-drupal-1 drush config:import --partial --source=/var/www/drupal/web/modules/contrib/islandora_workbench_integration/config/optional -y
docker exec isle-site-template-drupal-1 drush cr
- name: Explicitly state the admin password
run: docker exec isle-site-template-drupal-1 drush user:password admin 'admin'
- name: Create workbench_user role
run: |
docker exec isle-site-template-drupal-1 drush role:create workbench_user
docker exec isle-site-template-drupal-1 drush role:perm:add workbench_user "$(cat tests/assets/user-role-permissions.txt | sed '/^$/d' | tr '\n' ',')"
- name: Create test user with workbench_user role
run: |
docker exec isle-site-template-drupal-1 drush user:create test-user --mail='test@noreply.com' --password='testPassword'
docker exec isle-site-template-drupal-1 drush user:role:add workbench_user test-user
- name: Run islandora_tests_check
run: pytest -v --no-header tests/islandora_tests_check.py
env:
REQUESTS_CA_BUNDLE: ${{ github.workspace }}/isle-site-template/certs/rootCA.pem
- name: Run islandora_tests_paged_content
run: pytest -v --no-header tests/islandora_tests_paged_content.py
env:
REQUESTS_CA_BUNDLE: ${{ github.workspace }}/isle-site-template/certs/rootCA.pem
- name: Run islandora_tests
run: pytest -v --no-header tests/islandora_tests.py
- name: Run islandora_tests_recovery_mode
run: pytest -v --no-header tests/islandora_tests_recovery_mode.py
env:
REQUESTS_CA_BUNDLE: ${{ github.workspace }}/isle-site-template/certs/rootCA.pem
- name: Run csv_id_to_node_id_map_tests
run: python tests/csv_id_to_node_id_map_tests.py
# DEBUG ARTIFACTS - Add these steps at the end
- name: Collect debug artifacts on failure
if: failure()
run: |
mkdir -p debug-artifacts
# Docker container logs
echo "=== Docker container logs ===" > debug-artifacts/docker-info.log
docker ps -a >> debug-artifacts/docker-info.log
echo -e "\n=== Drupal container logs ===" >> debug-artifacts/docker-info.log
docker logs isle-site-template-drupal-1 >> debug-artifacts/drupal.log 2>&1 || echo "Could not get Drupal logs"
# Drupal status and configuration
docker exec isle-site-template-drupal-1 drush status > debug-artifacts/drupal-status.txt 2>&1 || echo "Could not get Drupal status"
docker exec isle-site-template-drupal-1 drush config:get system.site > debug-artifacts/site-config.txt 2>&1 || echo "Could not get site config"
# Workbench logs
cat workbench.log > debug-artifacts/workbench.log 2>&1 || echo "Could not get workbench logs"
# Environment variables and Python info
env | grep -E "(PYTHON|PATH|PWD)" > debug-artifacts/environment.txt
python --version >> debug-artifacts/environment.txt
pip list >> debug-artifacts/pip-packages.txt 2>&1 || echo "Could not list pip packages"
- name: Upload debug artifacts
if: failure()
uses: actions/upload-artifact@v7
with:
name: debug-artifacts-${{ github.run_id }}
path: debug-artifacts/
retention-days: 7