forked from Kagami/SVT-AV1
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (172 loc) · 5.99 KB
/
macos.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: macOS
on:
push:
paths-ignore:
- "Docs/*"
- .travis.yml
- appveyor.yml
- .gitignore
- "*.md"
pull_request:
paths-ignore:
- "Docs/*"
- .travis.yml
- appveyor.yml
- .gitignore
- "*.md"
jobs:
build:
runs-on: macos-10.15
strategy:
fail-fast: true
matrix:
include:
- generator: Xcode
- generator: Unix Makefiles
steps:
- uses: actions/checkout@v2
- name: Cache ccache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ matrix.generator }}-${{ hashFiles('**/*.c') }}
restore-keys: ${{ runner.os }}-${{ matrix.generator }}-
- name: Install dependencies
run: |
set -x
[ -d ~/.ccache ] && sudo chown -R "$USER": ~/.ccache
{
brew update || brew update-reset
brew upgrade yasm ccache cmake ninja || brew install -q yasm ccache cmake ninja
} || brew update-reset
printf '%s\n' \
"PATH=/usr/local/opt/ccache/libexec:$PATH" \
"CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
clang -v
- name: Run CMake
run: cmake -S "$GITHUB_WORKSPACE" -B Build -G"${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF
- name: Run Install
run: sudo -E cmake --build Build --parallel "$(sysctl -n hw.ncpu)" --config Release --target install
- name: Download videos
if: matrix.generator == 'Unix Makefiles'
run: |
for url in raw.githubusercontent.com/OpenVisualCloud/SVT-AV1-Resources/master randomderp.com; do
curl -LO https://$url/video.tar.gz && break
done
tar xf video.tar.gz
- name: Upload videos
if: matrix.generator == 'Unix Makefiles'
uses: actions/upload-artifact@v2
with:
name: svtav1-videos
path: "*.y4m"
- name: Upload binaries SVT-AV1 (macOS)
if: matrix.generator == 'Unix Makefiles'
uses: actions/upload-artifact@v2
with:
name: svtav1-macOS-binaries
path: Bin/Release
bit-depth-tests:
name: ${{ matrix.bit }} tests
runs-on: macos-10.15
needs: build
strategy:
fail-fast: false
matrix:
include:
- bit: 8
video: akiyo_cif.y4m
- bit: 10
video: Chimera-Aerial_480x264_2997fps_10bit_420_150frames.y4m
steps:
- name: Download binaries SVT-AV1 (macOS)
uses: actions/download-artifact@v2
with:
name: svtav1-macOS-binaries
- name: Download videos
uses: actions/download-artifact@v2
with:
name: svtav1-videos
- name: Print system info
run: |
sysctl -n machdep.cpu.brand_string
sysctl -n machdep.cpu.features machdep.cpu.leaf7_features | sort -u
- name: ${{ matrix.bit }}bit tests
run: |
chmod +x SvtAv1EncApp
./SvtAv1EncApp --preset 0 -i ${{ matrix.video }} -n 3 -b test-pr-${{ matrix.bit }}bit-m0.ivf
./SvtAv1EncApp --preset 8 -i ${{ matrix.video }} -n 120 -b test-pr-${{ matrix.bit }}bit-m8.ivf
prep-tests:
runs-on: [self-hosted, macos]
name: Build unit tests
env:
SVT_AV1_TEST_VECTOR_PATH: ${{ github.workspace }}/test/vectors
steps:
- name: Chown whole dir
run: sudo chown -R "$USER" "${{ github.workspace }}"
- uses: actions/checkout@v2
with:
clean: false
- name: Install dependencies
run: |
[ -d ~/.ccache ] && sudo chown -R "$USER": ~/.ccache
{
brew update || brew update-reset
brew upgrade yasm ccache cmake ninja || brew install -q yasm ccache cmake ninja
} || brew update-reset
printf '%s\n' \
"PATH=/usr/local/opt/ccache/libexec:$PATH" \
"CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
clang -v
rm -rf macos-build
- name: Run CMake
run: |
cmake -S "$GITHUB_WORKSPACE" -B macos-build -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DBUILD_APPS=OFF
cmake --build macos-build --config Release --target all
- name: Upload unit-tests (macOS)
uses: actions/upload-artifact@v2
with:
name: svtav1-macOS-unittest
path: Bin/Release
unit-tests:
runs-on: [self-hosted, macos]
needs: prep-tests
name: Unit Tests (MacOS, Clang)
env:
GTEST_TOTAL_SHARDS: 10
steps:
- uses: actions/checkout@v2
with:
clean: false
- name: Download unit-tests (macOS)
uses: actions/download-artifact@v2
with:
name: svtav1-macOS-unittest
path: Bin/Release
- name: Run unit tests
run: |
cmake -S "$GITHUB_WORKSPACE" -B macos-vectors -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DBUILD_APPS=OFF
cmake --build macos-vectors --config Release --target TestVectors
chmod +x ./Bin/Release/SvtAv1UnitTests
parallel -u -j 4 GTEST_SHARD_INDEX={} ./Bin/Release/SvtAv1UnitTests ::: $(seq 0 $((GTEST_TOTAL_SHARDS - 1)))
e2e-tests:
runs-on: [self-hosted, macos]
needs: prep-tests
name: E2E Tests (MacOS, Clang)
env:
SVT_AV1_TEST_VECTOR_PATH: ${{ github.workspace }}/test/vectors
steps:
- uses: actions/checkout@v2
with:
clean: false
- name: Download unit-tests (macOS)
uses: actions/download-artifact@v2
with:
name: svtav1-macOS-unittest
path: Bin/Release
- name: Run e2e tests
run: |
[ -d macos-vectors ] || cmake -S "$GITHUB_WORKSPACE" -B macos-vectors -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DBUILD_APPS=OFF
cmake --build macos-vectors --config Release --target TestVectors
chmod +x ./Bin/Release/SvtAv1E2ETests
./Bin/Release/SvtAv1E2ETests --gtest_filter=-*DummySrcTest*