-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcider-ci.yml
68 lines (61 loc) · 2.24 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
jobs:
# NOTE: the other jobs depend on build, even though its not strictly needed because of caching, but so we know where to look for the full log
build:
name: Build `dist`
run_when:
any branch is pushed: { type: branch, include_match: ^.*$ }
include: cider-ci/task-components/defaults.yml
tasks:
build:
include: cider-ci/task-components/build.yml
lint:
name: Lint
depends_on:
build is done: { type: job, job_key: build, states: [passed] }
run_when:
any branch is pushed: { type: branch, include_match: ^.*$ }
build is done: { type: job, job_key: build, states: [passed] }
include: cider-ci/task-components/defaults.yml
tasks:
lint:
include: cider-ci/task-components/lint.yml
test:
name: Test
depends_on:
build is done: { type: job, job_key: build, states: [passed] }
run_when:
any branch is pushed: { type: branch, include_match: ^.*$ }
build is done: { type: job, job_key: build, states: [passed] }
include: cider-ci/task-components/defaults.yml
tasks:
build-and-test:
include:
- cider-ci/task-components/build.yml
- cider-ci/task-components/test.yml
all-ok:
name: 'All Tests OK'
depends_on: &ALLOK_DEP
test passed: { type: job, job_key: test, states: [passed] }
build passed: { type: job, job_key: build, states: [passed] }
lint passed: { type: job, job_key: lint, states: [passed] }
run_when: *ALLOK_DEP
task: 'echo ALL OK'
good-to-merge:
name: '⚑ Good To Merge'
depends_on: &MERGE_DEP
all passed: { type: job, job_key: all-ok, states: [passed] }
run_when: *MERGE_DEP
tasks:
# NOTE: "linear history" is already enforced via GitHub branch protection
git-branch-current:
name: 'git: tree contains latest commit from origin/master'
aggregate_state: satisfy-last # relies on external state!
scripts:
test:
body: |
#!/usr/bin/env bash
set -eu
# check if your tree still contains the current commit from master
git fetch --all -q 1>&2
git rev-list --children HEAD | grep -q "$(git rev-parse origin/master)"
echo "OK"