-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (88 loc) · 3.17 KB
/
erlang.yml
File metadata and controls
101 lines (88 loc) · 3.17 KB
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
---
name: ci
permissions:
contents: write
on:
# for feature branches and releases
push:
concurrency:
group: ${{ (github.ref != 'refs/heads/master') && format('{0}-{1}', github.ref, github.workflow) || github.run_id }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build_and_test:
runs-on: ubuntu-24.04
name: OTP ${{matrix.otp}}
strategy:
matrix:
otp: ["26", "27"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
token: ${{secrets.GITHUB_TOKEN}}
- uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1.23.0
with:
otp-version: ${{ matrix.otp }}
rebar3-version: '3.24'
- name: Compile
run: |
# Since we can't force CI to run after pushing rebar.lock
# we remove it to make sure we test over rebar.config
rm -f rebar.lock
make
- name: Run xref
run: make xref
#- name: Run elvis
# run: make elvis_rock
- name: Run dialyzer
run: make dialyze
- name: Run proper tests
run: make proper
# The result of the following step can't be completely automated, it seems,
# since the 'git push' prevents the workflow's status from being reported
# In this case, we need to analyze the results of the previous
# 'Run Erlang Tests' step, and, when Ok, force- merge it!
- if: matrix.otp == '27'
run: |
if [[ "${REF}" =~ refs/heads/renovate/.* ]]; then
echo "ℹ️ This appears to come from a Renovate PR. Trying rebar.lock update..."
ORIGIN="origin/${{ github.event.repository.default_branch }}"
if ! git diff --quiet --exit-code "${ORIGIN}"..HEAD -- rebar.config; then
rebar3 upgrade --all
CHECK_FILE=rebar.lock
if ! git diff --quiet --exit-code "${CHECK_FILE}"; then
# there's stuff to push
git config user.name "Renovate Bot"
git config user.email "bot@renovateapp.com"
git add "${CHECK_FILE}"
git commit -m "auto-update(deps): Changes in ${CHECK_FILE}"
git push origin HEAD:"${REF}"
fi
fi
fi
env:
REF: ${{ github.ref }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
release:
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'no-release') == false
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
token: ${{secrets.GITHUB_TOKEN}}
- name: Bump version and push tag
id: tag-version
uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b # v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
release_branches: master
- name: Create a GitHub release
run: |
if ! command -v gh >/dev/null 2>&1; then
curl -sS https://webi.sh/gh | sh
fi
gh release create ${{ steps.tag-version.outputs.new_tag }} --generate-notes --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}