forked from nerves-project/nerves
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
95 lines (88 loc) · 2.59 KB
/
config.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
version: 2.1
latest: &latest
pattern: "^1.17.*-erlang-27.*$"
tags: &tags
[
1.17.3-erlang-27.1.2-alpine-3.20.3,
1.16.3-erlang-26.2.5-alpine-3.20.0,
1.15.7-erlang-26.2.1-alpine-3.18.4,
1.14.5-erlang-25.3.2-alpine-3.18.0,
1.13.4-erlang-24.3.4-alpine-3.15.3
]
jobs:
build-test:
parameters:
tag:
type: string
docker:
- image: hexpm/elixir:<< parameters.tag >>
working_directory: ~/repo
environment:
LC_ALL: C.UTF-8
steps:
- run:
name: Install system dependencies
command: apk add --no-cache build-base procps
- checkout
- run:
name: Install hex, rebar, and nerves_bootstrap
command: |
mix local.hex --force
mix local.rebar --force
mix archive.install hex nerves_bootstrap --force
- restore_cache:
keys:
- v1-mix-cache-<< parameters.tag >>-{{ checksum "mix.lock" }}
- run: mix deps.get
- when:
condition:
matches: { <<: *latest, value: << parameters.tag >> }
steps:
- run: mix format --check-formatted
- run: mix deps.unlock --check-unused
- run: mix docs
- run: mix hex.build
- run: mix test || mix test
- run: mix credo -a --strict
- run: mix dialyzer
- when:
condition:
not:
matches: { <<: *latest, value: << parameters.tag >> }
steps:
- run: mix test --exclude release || mix test --exclude release
- save_cache:
key: v1-mix-cache-<< parameters.tag >>-{{ checksum "mix.lock" }}
paths:
- _build
- deps
automerge:
docker:
- image: alpine:3.18.4
steps:
- run:
name: Install GitHub CLI
command: apk add --no-cache build-base github-cli
- run:
name: Attempt PR automerge
command: |
author=$(gh pr view "${CIRCLE_PULL_REQUEST}" --json author --jq '.author.login' || true)
if [ "$author" = "app/dependabot" ]; then
gh pr merge "${CIRCLE_PULL_REQUEST}" --auto --rebase || echo "Failed trying to set automerge"
else
echo "Not a dependabot PR, skipping automerge"
fi
workflows:
checks:
jobs:
- build-test:
name: << matrix.tag >>
matrix:
parameters:
tag: *tags
- automerge:
requires: *tags
context: org-global
filters:
branches:
only: /^dependabot.*/