-
Notifications
You must be signed in to change notification settings - Fork 776
70 lines (56 loc) · 2.34 KB
/
elixir_dep_verification_and_static_analysis.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
name: Elixir Dependency Verification and Static Analysis
on:
workflow_call:
env:
CACHE_NAME_DEPS: cache-elixir-deps
CACHE_NAME_COMPILED_DEV: cache-compiled-dev-build
CACHE_NAME_COMPILED_TEST: cache-compiled-test-build
ELIXIR_ASSERT_TIMEOUT: 1000
permissions:
contents: read
jobs:
verify_dependencies_and_static_analysis:
name: Verify dependencies, POT files, unused dependencies, static analysis
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Elixir and Cache Dependencies
id: setup-elixir-and-cache-deps
uses: ./.github/actions/setup-elixir-and-cache-deps
with:
cache-name-deps: ${{ env.CACHE_NAME_DEPS }}
cache-name-compiled: ${{ env.CACHE_NAME_COMPILED_DEV }}
mix-env: dev
- name: Compile without warnings
run: mix compile --warnings-as-errors
shell: sh
- name: Verify that POT files are up to date
run: mix gettext.extract --check-up-to-date
- name: Check unused dependencies
run: mix deps.unlock --check-unused
- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
key: |
${{ runner.os }}-${{ steps.setup-elixir-and-cache-deps.outputs.elixir-version }}-${{ steps.setup-elixir-and-cache-deps.outputs.otp-version }}-plt
restore-keys: |
${{ runner.os }}-${{ steps.setup-elixir-and-cache-deps.outputs.elixir-version }}-${{ steps.setup-elixir-and-cache-deps.outputs.otp-version }}-plt
path: |
priv/plts
- name: Create Persistent Lookup Tables (PLTs) for Dialyzer
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
- name: Save PLT cache
id: plt_cache_save
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
if: steps.plt_cache.outputs.cache-hit != 'true'
with:
key: |
${{ runner.os }}-${{ steps.setup-elixir-and-cache-deps.outputs.elixir-version }}-${{ steps.setup-elixir-and-cache-deps.outputs.otp-version }}-plt
path: |
priv/plts
- name: Run dialyzer for static analysis
run: mix dialyzer --format github