-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (108 loc) · 3.81 KB
/
Copy pathelixir.yml
File metadata and controls
129 lines (108 loc) · 3.81 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Elixir CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.19.2'
otp-version: '28.0'
version-type: 'strict'
id: beam
- name: Restore PLT cache
uses: actions/cache@v4
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-plt-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-plt-
- name: Install system dependencies and FFmpeg
run: |
sudo apt-get update
sudo apt-get install -y \
mediainfo \
ffmpeg \
gpac \
mkvtoolnix \
build-essential
- name: Cache Rust toolchain
uses: actions/cache@v4
id: rust-toolchain-cache
with:
path: |
~/.rustup
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: ${{ runner.os }}-rust-toolchain-v3
restore-keys: |
${{ runner.os }}-rust-toolchain-
- name: Cache ab-av1 binary
uses: actions/cache@v4
id: ab-av1-cache
with:
path: ~/.cargo/bin/ab-av1
key: ${{ runner.os }}-ab-av1-binary-v3
restore-keys: |
${{ runner.os }}-ab-av1-binary-
- name: Install Rust toolchain
if: steps.rust-toolchain-cache.outputs.cache-hit != 'true'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
- name: Install ab-av1
if: steps.ab-av1-cache.outputs.cache-hit != 'true'
run: |
source ~/.cargo/env
cargo install ab-av1 --locked
- name: Setup cargo PATH
run: |
# Ensure cargo is available in PATH for subsequent steps
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
source ~/.cargo/env || true
- name: Cache Mix dependencies and build
uses: actions/cache@v4
id: mix-cache
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles('**/mix.lock') }}-${{ hashFiles('lib/**/*.ex', 'config/**/*.exs') }}
restore-keys: |
${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles('**/mix.lock') }}-
${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-mix-
- name: Verify environment
run: |
echo 'Elixir version:' && elixir --version
echo 'Erlang version:' && erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
echo 'ab-av1 version:' && ab-av1 --version
echo 'mediainfo version:' && mediainfo --version | head -1
echo 'ffmpeg version:' && ffmpeg -version | head -1
echo 'MP4Box version:' && MP4Box -version
echo 'mkvpropedit version:' && mkvpropedit --version | head -1
- name: Install dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Compile dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.compile
- name: Compile project
run: mix compile --warnings-as-errors
- name: Check formatting
run: mix format --check-formatted
- name: Run Credo
run: mix credo --strict
- name: Run tests
run: mix test