-
Notifications
You must be signed in to change notification settings - Fork 16
120 lines (113 loc) · 3.17 KB
/
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
name: CI
'on':
push:
branches:
- github*
- master
tags:
- '*'
pull_request:
branches:
- '**'
schedule:
- cron: 0 0 * * *
jobs:
ci:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
otp_vsn:
- 'slim'
- '27-slim'
- '26.2-slim'
- '26.1-slim'
- '26-slim'
- '25.3-slim'
- '25.2-slim'
- '25.1-slim'
- '25-slim'
- '24.3-slim'
- '24.2-slim'
- '24.1-slim'
- '24.0-slim'
- '23.3-slim'
- '23.2-slim'
- '23.1-slim'
- '23-slim'
- '22.3-slim'
- '22.2-slim'
- '22-slim'
- '21.3-slim'
# NOTE testing disabled for the following versions, as the Docker image is based on Debian 9 (EOL) and
# either git depends on libpcre2-8-0 but it is not installable
# either actions/checkout's nodejs20 depends on a newer libc
# NOTE jesse might still be OTP-compatible though
# - '22.1-slim'
# - '21.2-slim'
# - '21.1-slim'
# - '21-slim'
# - '20.3-slim'
# - '19.3-slim'
# - '19.2-slim'
# - '19.1-slim'
# - '19-slim'
# - '18.2-slim'
# - '18.1-slim'
# - '18-slim'
name: 'ci-erl:${{ matrix.otp_vsn }}'
runs-on: ubuntu-latest
container:
image: 'erlang:${{ matrix.otp_vsn }}'
steps:
- shell: bash
run: |
# NOTE sync with ./Dockerfile.build.sh
apt-get -y update
apt-get -y install curl git make
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
# https://github.com/actions/runner/issues/2033
# https://github.com/actions/checkout/issues/766
- shell: bash
run: |
chown -R "$(id -u):$(id -g)" "${GITHUB_WORKSPACE}"
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
# DEV_MODE
# - shell: bash
# run: make
- shell: bash
run: make clean _build/DEV_MODE
- shell: bash
run: make all xref eunit
- if: ${{ matrix.otp_vsn == 'slim' }}
shell: bash
run: make check test_cli dialyzer
# BARE_MODE
- shell: bash
run: make clean _build/BARE_MODE
- shell: bash
run: make all xref # eunit
- if: ${{ matrix.otp_vsn == 'slim' }}
shell: bash
run: make check test_cli dialyzer
# PUBLISH TAGS
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
name: Check is-semver-tag
id: is-semver-tag
shell: bash
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "check=true" >> $GITHUB_OUTPUT
fi
- if: ${{ matrix.otp_vsn == 'slim' && steps.is-semver-tag.outputs.check == 'true'}}
name: Run make publish
shell: bash
env:
HEX_API_KEY: ${{secrets.HEX_API_KEY}}
run: |
mkdir -p ~/.config/rebar3
echo "{plugins, [rebar3_hex]}." > ~/.config/rebar3/rebar.config
make publish