-
Notifications
You must be signed in to change notification settings - Fork 0
/
cider-ci.yml
137 lines (128 loc) · 3.78 KB
/
cider-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
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
jobs:
meta:
name: Meta
description: |
Various superordinate quality assurance tasks
run_when:
always:
type: branch
include_match: '^.*$'
exclude_match: '^.*(no-ci|hotspot).*$'
context:
include:
- cider-ci/shared/main-context.yml
task_defaults:
max_trials: 1
environment_variables:
LEIHS_DATABASE_DIR: "{{CIDER_CI_WORKING_DIR}}"
RAILS_ENV: test
tasks:
check-migration-of-seeds:
name: "Check if seeds-dump needs to be migrated"
scripts:
test:
body: |
#!/usr/bin/env bash
set -euo pipefail
cd $LEIHS_DATABASE_DIR
unset PGPORT
unset PGUSER
PGPORT=${PG15PORT} PGUSER=${PG15USER} ./bin/seeds-check
check-migration-of-personas:
name: "Check if personas-dump needs to be migrated"
scripts:
test:
body: |
#!/usr/bin/env bash
set -euo pipefail
cd $LEIHS_DATABASE_DIR
unset PGPORT
unset PGUSER
PGPORT=${PG15PORT} PGUSER=${PG15USER} ./bin/personas-check
check-migration-of-demo:
name: "Check if demo-dump needs to be migrated"
scripts:
test:
body: |
#!/usr/bin/env bash
set -euo pipefail
cd $LEIHS_DATABASE_DIR
unset PGPORT
unset PGUSER
PGPORT=${PG15PORT} PGUSER=${PG15USER} ./bin/demo-check
specs:
name: 'Run specs'
run_when:
any branch has been updated:
type: branch
include_match: '^.*$'
exclude_match: '^.*(no-ci|hotspot).*$'
context:
include:
- cider-ci/shared/main-context.yml
generate_tasks:
include_match: spec/.*_spec.rb
task_defaults:
include:
- cider-ci/task-components/database.yml
environment_variables:
LEIHS_DATABASE_DIR: "{{CIDER_CI_WORKING_DIR}}"
LEIHS_DATABASE_NAME: leihs_{{CIDER_CI_TRIAL_ID}}
RAILS_ENV: test
traits:
Ruby: true
git_options:
submodules:
include_match: ^.*$
scripts:
test:
body: |
#!/usr/bin/env bash
set -euo pipefail
cd ${LEIHS_DATABASE_DIR}
mkdir -p log
unset PGPORT
unset PGUSER
PGUSER="${PG15USER}" PGPORT="${PG15PORT}" ./bin/rspec --backtrace $CIDER_CI_TASK_FILE
good-to-merge:
name: Good To Merge
description: |
This job depends on all other tests and checks
and it will pass if and only if all dependencies have passed.
Status of this job is **used by github's "branch protection"**!
depends_on: &GOOD_TO_MERGE_DEPENDENCIES
specs were successful:
type: job
job_key: specs
states: [passed]
meta checks were successful:
type: job
job_key: meta
states: [passed]
run_when: *GOOD_TO_MERGE_DEPENDENCIES
context:
task_defaults:
max_trials: 1
tasks:
all relevant tests have passed:
name: "All relevant tests have passed, thus good to merge"
scripts:
main:
body: echo 'All relevant tests have passed' ; exit 0
merged-to-master:
name: "Merged to master"
priority: 999
depends_on:
master branch matches:
type: branch
include_match: ^master$
run_when:
master branch matches:
type: branch
include_match: ^master$
context:
tasks:
merged-to-master:
scripts:
test:
body: "exit 0"