Skip to content

Commit 248e202

Browse files
chore: sync files with stordco/common-config-elixir
1 parent 1807c0e commit 248e202

12 files changed

+355
-47
lines changed

.credo.exs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# You can give explicit globs or simply directories.
2424
# In the latter case `**/*.{ex,exs}` will be used.
2525
#
26-
included: ["lib/", "priv/", "test/"],
26+
included: ["config/", "lib/", "priv/", "test/"],
2727
excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"]
2828
},
2929
#
@@ -81,7 +81,7 @@
8181
# You can customize the priority of any check
8282
# Priority values are: `low, normal, high, higher`
8383
#
84-
{Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 2]},
84+
{Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 4, if_called_more_often_than: 2]},
8585
{Credo.Check.Design.DuplicatedCode, false},
8686
# You can also customize the exit_status of each check.
8787
# If you don't want TODO comments to cause `mix credo` to fail, just
@@ -119,7 +119,8 @@
119119
[
120120
order:
121121
~w(moduledoc behaviour use import require alias module_attribute defstruct callback macrocallback optional_callback)a,
122-
ignore: [:type]
122+
ignore: [:type],
123+
ignore_module_attributes: [:contract, :decorate, :operation, :trace]
123124
]},
124125
{Credo.Check.Readability.StringSigils, []},
125126
{Credo.Check.Readability.TrailingBlankLine, []},
@@ -177,7 +178,17 @@
177178
{Credo.Check.Warning.UnusedPathOperation, []},
178179
{Credo.Check.Warning.UnusedRegexOperation, []},
179180
{Credo.Check.Warning.UnusedStringOperation, []},
180-
{Credo.Check.Warning.UnusedTupleOperation, []}
181+
{Credo.Check.Warning.UnusedTupleOperation, []},
182+
183+
#
184+
## Custom
185+
#
186+
{Credo.Check.Warning.ForbiddenModule,
187+
[
188+
modules: [
189+
{Oban.Worker, "use Oban.Pro.Worker instead"}
190+
]
191+
]}
181192
]
182193
}
183194
]

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Related Ticket(s)
2+
3+
<!--
4+
Enter the Jira issue below in the following format: PROJECT-##
5+
-->
6+
7+
## Checklist
8+
9+
<!--
10+
For each bullet, ensure your pr meets the criteria and write a note explaining how this PR relates. Mark them as complete as they are done. All top-level checkboxes should be checked regardless of their relevance to the pr with a note explaining whether they are relevant or not.
11+
-->
12+
13+
- [ ] Code conforms to the [Elixir Styleguide](https://github.com/christopheradams/elixir_style_guide)
14+
15+
## Problem
16+
17+
<!--
18+
What is the problem you're solving or feature you're implementing? Link to any Jira tickets or previous discussions of the issue.
19+
-->
20+
21+
## Details
22+
23+
<!--
24+
Include a brief overview of the technical process you took (or are going to take!) to get from the problem to the solution.
25+
-->

.release-please-config.json renamed to .github/release-please-config-stable.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
"section": "Features",
88
"hidden": false
99
},
10+
{
11+
"type": "hotfix",
12+
"section": "Hotfixes",
13+
"hidden": true
14+
},
1015
{
1116
"type": "fix",
1217
"section": "Bug Fixes",
@@ -22,9 +27,7 @@
2227
"draft-pull-request": false,
2328
"packages": {
2429
".": {
25-
"extra-files": [
26-
"README.md"
27-
],
30+
"extra-files": ["README.md"],
2831
"release-type": "elixir"
2932
}
3033
},
File renamed without changes.

.github/workflows/ci.yaml

Lines changed: 143 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,251 @@
1+
# This file is synced with stordco/common-config-elixir. Any changes will be overwritten.
2+
13
name: CI
24

35
on:
6+
merge_group:
47
pull_request:
58
types:
69
- opened
710
- reopened
811
- synchronize
9-
merge_group:
12+
push:
13+
branches:
14+
- main
15+
- code-freeze/**
1016
workflow_call:
1117
secrets:
18+
CI_SERVICE_KEY:
19+
required: true
1220
GH_PERSONAL_ACCESS_TOKEN:
1321
required: true
1422
HEX_API_KEY:
1523
required: true
1624
workflow_dispatch:
1725

26+
concurrency:
27+
group: ${{ github.head_ref || github.run_id }}
28+
cancel-in-progress: true
29+
1830
jobs:
31+
Changed:
32+
name: Changed Files
33+
runs-on: ubuntu-latest
34+
35+
outputs:
36+
database: ${{ steps.changed.outputs.database_any_changed }}
37+
docker: ${{ steps.changed.outputs.docker_any_changed }}
38+
elixir: ${{ steps.changed.outputs.elixir_any_changed }}
39+
helm: ${{ steps.changed.outputs.helm_any_changed }}
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 2
46+
47+
- id: changed
48+
name: Get Changed Files
49+
uses: tj-actions/changed-files@v44
50+
with:
51+
files_yaml: |
52+
database:
53+
- '.github/workflows/ci.yaml'
54+
- 'priv/*repo/**'
55+
docker:
56+
- '.github/workflows/ci.yaml'
57+
- 'Dockerfile'
58+
documentation:
59+
- 'docs/**'
60+
- 'priv/documentation/**'
61+
- '**.ex'
62+
- '**.md'
63+
elixir:
64+
- '.github/workflows/ci.yaml'
65+
- '.tool-versions'
66+
- 'priv/**'
67+
- '**.ex'
68+
- '**.exs'
69+
- '**.heex'
70+
helm:
71+
- '.github/workflows/ci.yaml'
72+
- '.github/workflows/staging.yaml'
73+
- '.github/workflows/production.yaml'
74+
- 'helm/**'
75+
1976
Credo:
77+
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }}
78+
needs: [Changed]
2079
runs-on: ubuntu-latest
2180

2281
steps:
2382
- name: Checkout
24-
uses: actions/checkout@v3
83+
uses: actions/checkout@v4
2584

2685
- name: Setup Elixir
2786
uses: stordco/actions-elixir/setup@v1
2887
with:
2988
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
3089
hex-token: ${{ secrets.HEX_API_KEY }}
90+
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }}
91+
oban-token: ${{ secrets.OBAN_LICENSE_KEY }}
3192

3293
- name: Credo
33-
run: mix credo
94+
run: mix credo --strict
3495

35-
Deps:
96+
Dependencies:
97+
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }}
98+
needs: [Changed]
3699
runs-on: ubuntu-latest
37100

101+
env:
102+
MIX_ENV: test
103+
38104
steps:
39105
- name: Checkout
40-
uses: actions/checkout@v3
106+
uses: actions/checkout@v4
41107

42108
- name: Setup Elixir
43109
uses: stordco/actions-elixir/setup@v1
44110
with:
45111
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
46112
hex-token: ${{ secrets.HEX_API_KEY }}
113+
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }}
114+
oban-token: ${{ secrets.OBAN_LICENSE_KEY }}
47115

48116
- name: Unused
49117
run: mix deps.unlock --check-unused
50118

51119
Dialyzer:
120+
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }}
121+
needs: [Changed]
52122
runs-on: ubuntu-latest
53123

54124
steps:
55125
- name: Checkout
56-
uses: actions/checkout@v3
126+
uses: actions/checkout@v4
57127

58128
- name: Setup Elixir
59129
uses: stordco/actions-elixir/setup@v1
60130
with:
61131
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
62132
hex-token: ${{ secrets.HEX_API_KEY }}
133+
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }}
134+
oban-token: ${{ secrets.OBAN_LICENSE_KEY }}
63135

64136
- name: Dialyzer
65137
run: mix dialyzer --format github
66138

67-
Docs:
139+
Documentation:
140+
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.documentation == 'true' }}
141+
needs: [Changed]
68142
runs-on: ubuntu-latest
69143

70144
steps:
71145
- name: Checkout
72-
uses: actions/checkout@v3
146+
uses: actions/checkout@v4
73147

74148
- name: Setup Elixir
75149
uses: stordco/actions-elixir/setup@v1
76150
with:
77151
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
78152
hex-token: ${{ secrets.HEX_API_KEY }}
153+
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }}
154+
oban-token: ${{ secrets.OBAN_LICENSE_KEY }}
79155

80156
- name: Docs
81157
run: mix docs
82158

83159
Format:
160+
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }}
161+
needs: [Changed]
84162
runs-on: ubuntu-latest
85163

86164
steps:
87165
- name: Checkout
88-
uses: actions/checkout@v3
166+
uses: actions/checkout@v4
89167

90168
- name: Setup Elixir
91169
uses: stordco/actions-elixir/setup@v1
92170
with:
93171
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
94172
hex-token: ${{ secrets.HEX_API_KEY }}
173+
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }}
174+
oban-token: ${{ secrets.OBAN_LICENSE_KEY }}
95175

96176
- name: Format
97177
run: mix format --check-formatted
98178

99179
Test:
180+
name: Test (Elixir ${{ matrix.versions.elixir }} OTP ${{ matrix.versions.otp }})
181+
100182
runs-on: ubuntu-latest
101183

102184
env:
103-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104185
MIX_ENV: test
105186

187+
106188
steps:
107189
- name: Checkout
108-
uses: actions/checkout@v3
190+
uses: actions/checkout@v4
109191

110192
- name: Setup Elixir
111193
uses: stordco/actions-elixir/setup@v1
112194
with:
195+
elixir-version: ${{ matrix.versions.elixir }}
113196
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
114197
hex-token: ${{ secrets.HEX_API_KEY }}
198+
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }}
199+
oban-token: ${{ secrets.OBAN_LICENSE_KEY }}
200+
otp-version: ${{ matrix.versions.otp }}
115201

116202
- name: Compile
117203
run: mix compile --warnings-as-errors
118204

119205
- name: Test
120-
run: mix test
206+
run: mix coveralls.github
207+
env:
208+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
209+
210+
strategy:
211+
fail-fast: false
212+
matrix:
213+
versions:
214+
- elixir: 1.13
215+
otp: 25
216+
- elixir: 1.14
217+
otp: 25
218+
- elixir: 1.15
219+
otp: 26
220+
221+
Trivy_Filesystem:
222+
if: ${{ !startsWith(github.head_ref, 'release-please--branches') }}
223+
name: Trivy Filesystem Scan
224+
runs-on: ubuntu-latest
225+
226+
permissions:
227+
contents: read
228+
id-token: write
229+
pull-requests: write
230+
231+
steps:
232+
- name: Checkout
233+
uses: actions/checkout@v4
234+
235+
- name: Setup Elixir
236+
uses: stordco/actions-elixir/setup@v1
237+
with:
238+
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
239+
hex-token: ${{ secrets.HEX_API_KEY }}
240+
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }}
241+
oban-token: ${{ secrets.OBAN_LICENSE_KEY }}
242+
243+
- name: Trivy Scan
244+
uses: stordco/actions-trivy@v1
245+
with:
246+
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
247+
scan-type: fs
248+
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
249+
slack-channel-id: ${{ secrets.SLACK_SECURITY_ALERTS }}
250+
update-db: false
251+

.github/workflows/common-config-elixir.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,24 @@ jobs:
2121

2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
with:
2626
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
2727
persist-credentials: true
2828

2929
- name: Setup Node
30-
uses: actions/setup-node@v3
30+
uses: actions/setup-node@v4
3131
with:
32-
node-version: 16
32+
node-version: 18
3333

3434
- name: Setup Elixir
3535
uses: stordco/actions-elixir/setup@v1
3636
with:
37+
elixir-version: "1.15"
3738
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
3839
hex-token: ${{ secrets.HEX_API_KEY }}
39-
elixir-version: "1.15"
40+
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }}
41+
oban-token: ${{ secrets.OBAN_LICENSE_KEY }}
4042
otp-version: "26.0"
4143

4244
- name: Sync

0 commit comments

Comments
 (0)