@@ -10,116 +10,56 @@ env:
1010 MIX_ENV : test
1111
1212jobs :
13- # Matrix testing for compatibility (inspired by Anthropix)
13+ # Single test job using mise
1414 test :
15- name : Test (Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}})
15+ name : Test and Lint
1616 runs-on : ubuntu-latest
17- strategy :
18- fail-fast : false
19- matrix :
20- include :
21- # Primary development version (uses mise)
22- - elixir : " mise"
23- otp : " mise"
24- use_mise : true
25- lint : true
26- coverage : true
27- # Compatibility testing (uses erlef/setup-beam)
28- - elixir : " 1.17"
29- otp : " 26"
30- use_mise : false
31- - elixir : " 1.18"
32- otp : " 27"
33- use_mise : false
34-
3517 steps :
3618 - name : Checkout code
3719 uses : actions/checkout@v4
3820
39- # Setup using mise (for primary development version)
4021 - name : Install mise and tools
41- if : matrix.use_mise
4222 uses : jdx/mise-action@v3
4323 with :
4424 install : true
4525 cache : true
4626 github_token : ${{ secrets.GITHUB_TOKEN }}
4727
48- # Setup using erlef/setup-beam (for compatibility testing)
49- - name : Setup Elixir
50- if : " !matrix.use_mise"
51- uses : erlef/setup-beam@v1
52- with :
53- elixir-version : ${{ matrix.elixir }}
54- otp-version : ${{ matrix.otp }}
55- version-type : strict
56-
57- # Enhanced caching strategy
58- - name : Cache dependencies (mise)
59- if : matrix.use_mise
60- uses : actions/cache@v4
61- with :
62- path : |
63- deps/
64- _build/
65- key : ${{ runner.os }}-mise-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ hashFiles('mise.toml') }}
66- restore-keys : |
67- ${{ runner.os }}-mise-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-
68- ${{ runner.os }}-mise-mix-
69-
70- - name : Cache dependencies (standard)
71- if : " !matrix.use_mise"
28+ - name : Cache dependencies
7229 uses : actions/cache@v4
7330 with :
7431 path : |
7532 deps/
7633 _build/
77- key : ${{ runner.os }}-${{ matrix.elixir }}-otp ${{ matrix.otp }}-mix- ${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock') ) }}
34+ key : ${{ runner.os }}-mix- ${{ hashFiles('**/mix.lock') }}-${{ hashFiles('mise.toml' ) }}
7835 restore-keys : |
79- ${{ runner.os }}-${{ matrix.elixir }}-otp ${{ matrix.otp }}-mix -
36+ ${{ runner.os }}-mix- ${{ hashFiles('**/mix.lock') }}-
8037 ${{ runner.os }}-mix-
8138
8239 - name : Install dependencies
8340 run : mix deps.get
8441
85- # Conditional linting (inspired by OpenAI_ex)
8642 - name : Check code formatting
87- if : matrix.lint
8843 run : mix format --check-formatted
8944
9045 - name : Check for unused dependencies
91- if : matrix.lint
9246 run : mix deps.unlock --check-unused
9347
9448 - name : Run Credo
95- if : matrix.lint
9649 run : mix credo --strict
9750
98- - name : Compile application (warnings as errors for lint job)
99- if : matrix.lint
51+ - name : Compile application
10052 run : mix compile --warnings-as-errors
10153
102- - name : Compile application (standard)
103- if : " !matrix.lint"
104- run : mix compile
105-
106- - name : Run tests (with warnings as errors for lint job)
107- if : matrix.lint
54+ - name : Run tests
10855 run : mix test --warnings-as-errors
10956
110- - name : Run tests (standard)
111- if : " !matrix.lint"
112- run : mix test
113-
114- # Coverage only on primary version
11557 - name : Generate coverage report
116- if : matrix.coverage
11758 run : mix coveralls.github
11859 env :
11960 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
12061
12162 - name : Upload coverage artifacts
122- if : matrix.coverage
12363 uses : actions/upload-artifact@v4
12464 with :
12565 name : coverage-report
0 commit comments