Skip to content

Commit e80e02e

Browse files
committed
The lint-and-test workflow now fails only if the automated tests for the versions used in the container image fail.
The workflow should pass if the tests pass when running under the same versons of Elixir and Erlang/OTP as the image. The matrix of tests is useful to see if we can use newer versions, but these tests should not make the workflow fail. As some of the source files are not formatted, the pseudo-linting fails. When we format the files, we should change the psudo-linting to fail the workflow, so we can keep the files formatted.
1 parent 975de4e commit e80e02e

File tree

2 files changed

+77
-25
lines changed

2 files changed

+77
-25
lines changed

.github/workflows/lint-and-test.yml

Lines changed: 77 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,73 @@ name: lint-and-test
33
on: [push, workflow_dispatch]
44

55
jobs:
6-
test:
6+
test-current:
77
strategy:
88
fail-fast: false
99
matrix:
10-
versions:
11-
- elixir: '1.14'
12-
otp: '24.2'
13-
- elixir: '1.14'
14-
otp: '24.3'
15-
- elixir: '1.14'
16-
otp: '25.3'
10+
os:
11+
- 'ubuntu-22.04'
12+
- 'ubuntu-24.04'
1713

18-
- elixir: '1.15'
19-
otp: '24.3'
20-
- elixir: '1.15'
21-
otp: '25.3'
22-
- elixir: '1.15'
23-
otp: '26.2'
14+
runs-on: ${{ matrix.os }}
15+
16+
services:
17+
postgres:
18+
image: postgres:10
19+
env:
20+
POSTGRES_USER: admin
21+
POSTGRES_PASSWORD: admin
22+
options: >-
23+
--health-cmd pg_isready
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
27+
ports:
28+
- 5432:5432
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- uses: erlef/setup-beam@v1
34+
with:
35+
elixir-version: '1.16'
36+
otp-version: '25.3'
37+
38+
- uses: actions/cache@v4
39+
with:
40+
path: |
41+
deps
42+
_build
43+
key: mix-${{ hashFiles('mix.lock') }}
44+
45+
- run: mix local.hex --force
46+
- run: mix local.rebar --force
47+
- run: mix deps.get
48+
- run: mix compile # after fixing warnings, add --warnings-as-errors
49+
- run: mix test
50+
51+
52+
test-matrix:
53+
# if a matrix-job with newer versions passes, advance the current versions!
54+
continue-on-error: true
55+
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
versions:
60+
# - elixir: '1.14'
61+
# otp: '24.2'
62+
# - elixir: '1.14'
63+
# otp: '24.3'
64+
# - elixir: '1.14'
65+
# otp: '25.3'
66+
#
67+
# - elixir: '1.15'
68+
# otp: '24.3'
69+
# - elixir: '1.15'
70+
# otp: '25.3'
71+
# - elixir: '1.15'
72+
# otp: '26.2'
2473

2574
- elixir: '1.16'
2675
otp: '24.3'
@@ -41,11 +90,15 @@ jobs:
4190
- 'ubuntu-24.04'
4291

4392
exclude:
44-
- versions:
45-
elixir: '1.14'
46-
otp: '24.2'
47-
os: 'ubuntu-24.04'
48-
- versions:
93+
- versions: # current
94+
elixir: '1.16'
95+
otp: '25.3'
96+
97+
# - versions: # not supported
98+
# elixir: '1.14'
99+
# otp: '24.2'
100+
# os: 'ubuntu-24.04'
101+
- versions: # not supported
49102
elixir: '1.16'
50103
otp: '24.3'
51104
os: 'ubuntu-22.04'
@@ -71,8 +124,8 @@ jobs:
71124

72125
- uses: erlef/setup-beam@v1
73126
with:
74-
otp-version: ${{ matrix.versions.otp }}
75127
elixir-version: ${{ matrix.versions.elixir }}
128+
otp-version: ${{ matrix.versions.otp }}
76129

77130
- uses: actions/cache@v4
78131
with:
@@ -84,11 +137,12 @@ jobs:
84137
- run: mix local.hex --force
85138
- run: mix local.rebar --force
86139
- run: mix deps.get
87-
- run: mix compile # --warnings-as-errors
140+
- run: mix compile # after fixing warnings, add --warnings-as-errors
88141
- run: mix test
89142

90143

91-
lint:
144+
pseudo-lint:
145+
continue-on-error: true # TODO: use `mix format` & check in files, then set this false
92146
strategy:
93147
fail-fast: false
94148
matrix:
@@ -112,8 +166,8 @@ jobs:
112166

113167
- uses: erlef/setup-beam@v1
114168
with:
115-
otp-version: ${{ matrix.versions.otp }}
116169
elixir-version: ${{ matrix.versions.elixir }}
170+
otp-version: ${{ matrix.versions.otp }}
117171

118172
- uses: actions/cache@v4
119173
with:
@@ -122,5 +176,4 @@ jobs:
122176
_build
123177
key: mix-${{ hashFiles('mix.lock') }}
124178

125-
# - run: mix format '{lib,priv,test,config}/**/*.{ex,exs}'
126179
- run: mix format --check-formatted '{lib,priv,test,config}/**/*.{ex,exs}'

.github/workflows/ret-turkey.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
jobs:
99
turkeyGitops:
10-
if: github.repository_owner == 'Hubs-Foundation'
1110
uses: Hubs-Foundation/hubs-ops/.github/workflows/turkeyGitops.yml@master
1211
with:
1312
registry: hubsfoundation

0 commit comments

Comments
 (0)