forked from Islandora-Devops/isle-dc
-
Notifications
You must be signed in to change notification settings - Fork 6
112 lines (102 loc) · 3.68 KB
/
nightly.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
name: Nightly
on:
#schedule:
# - cron: '5 4 * * *'
push:
branches: [ development ]
workflow_dispatch:
jobs:
build:
name: build
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.test-matrix.outputs.matrix }}
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
steps:
# Check out current commit
- name: Checkout
uses: actions/checkout@v3
# Make sure buildkit is enabled
- name: Enable buildkit
shell: bash
run: |
echo '{"experimental": "enabled"}' > ~/.docker/config.json
# Build and run the static environment
- name: Build Static
run: make static-docker-compose.yml up
# Drush tests
- name: Drush test
run: docker-compose exec -T drupal drush -d status
- name: Export image
run: make static-drupal-image-export
- uses: actions/upload-artifact@v2
with:
name: drupal-image
path: images
- name: Generate Test Matrix
id: test-matrix
uses: jhu-idc/[email protected]
with:
key: suite
glob: '*nightly*.sh'
- name: Notify Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: failure()
test:
name: test
runs-on: ubuntu-latest
needs: build
strategy:
matrix: ${{ fromJSON(needs.build.outputs.matrix) }}
fail-fast: false
steps:
# Check out current commit
- name: Checkout
uses: actions/checkout@v3
- name: Download Drupal Image
uses: actions/download-artifact@v2
with:
name: drupal-image
path: images
- name: Load Drupal Image
run: docker load < images/static-drupal.tar
- name: Up
run: make up
- name: test
run: |
mkdir -p end-to-end/reports
chmod a+rwx end-to-end/reports
make test test=${{ matrix.suite }}
- name: reports
if: always()
run: |
mkdir -p end-to-end/reports/${{ matrix.suite }}
docker ps
docker logs idc_drupal_1 2>&1 | tee end-to-end/reports/${{ matrix.suite }}/drupal-${{ matrix.suite }}.log
docker logs idc_alpaca_1 2>&1 | tee end-to-end/reports/${{ matrix.suite }}/alpaca-${{ matrix.suite }}.log
docker logs idc_homarus_1 2>&1 | tee end-to-end/reports/${{ matrix.suite }}/homarus-${{ matrix.suite }}.log
docker logs idc_crayfits_1 2>&1 | tee end-to-end/reports/${{ matrix.suite }}/crayfits-${{ matrix.suite }}.log
docker logs idc_fits_1 2>&1 | tee end-to-end/reports/${{ matrix.suite }}/fits-${{ matrix.suite }}.log
docker logs idc_houdini_1 2>&1 | tee end-to-end/reports/${{ matrix.suite }}/houdini-${{ matrix.suite }}.log
docker logs idc_dlq_1 2>&1 | tee end-to-end/reports/${{ matrix.suite }}/dlq-${{ matrix.suite }}.log
- name: upload reports
if: always()
uses: actions/upload-artifact@v2
with:
name: reports-${{ matrix.suite }}
path: end-to-end/reports/${{ matrix.suite }}
#- name: Notify Slack
# uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message)
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
# MATRIX_CONTEXT: ${{ toJson(matrix) }} # required
# if: failure()