-
Notifications
You must be signed in to change notification settings - Fork 22
151 lines (151 loc) · 5.28 KB
/
build-and-test-x86.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
name: build and test on x86-64
on:
push:
branches:
- 'main'
pull_request:
jobs:
test-on-ubuntu-latest:
strategy:
matrix:
target: [
"x86_64-unknown-linux-gnu",
"i686-unknown-linux-gnu"
]
build: [
# release build without optimized assembly routines
{name: "release", flags: "--release --no-default-features --features=bitdepth_8,bitdepth_16", timeout_multiplier: 1},
# debug build with optimizations to catch overflows with optimized assembly routines
{name: "opt-dev", flags: "--profile opt-dev", timeout_multiplier: 3}
]
# Test with negative strides, threads and framedelay
variant: [
"",
"-n",
"-f 1",
"-f 2"
]
runs-on: ubuntu-latest
steps:
- name: install prerequisites
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: meson nasm gcc-multilib
version: 1.0 # version of cache to load
- name: git checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: cache rust toolchain
uses: actions/cache@v4
with:
path: |
~/.rustup/toolchains
~/.rustup/update-hashes
~/.rustup/settings.toml
key: ${{ runner.os }}-${{ matrix.target }}-rust-toolchain-${{ hashFiles('rust-toolchain', 'rust-toolchain.toml') }}
- name: cache rust crates
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: cargo build for ${{ matrix.target }} ${{ matrix.build.name }}
run: |
cargo clean
rustup target add --toolchain stable ${{ matrix.target }}
cargo +stable build --target ${{ matrix.target }} ${{ matrix.build.flags }}
- name: meson test for ${{ matrix.target }} ${{ matrix.build.name }}
run: |
.github/workflows/test.sh \
-r target/${{ matrix.target }}/${{ matrix.build.name }}/dav1d \
-s target/${{ matrix.target }}/${{ matrix.build.name }}/seek_stress \
-t ${{ matrix.build.timeout_multiplier }} \
${{ matrix.variant }}
- name: copy log files
if: ${{ !cancelled() }}
run: |
cp ${{ github.workspace }}/build/meson-logs/testlog.txt \
${{ github.workspace }}/build/meson-logs/testlog-${{ matrix.target }}-${{ matrix.build.name }}.txt
- name: upload build artifacts
# don't upload artifacts for all the test variants to keep names unique
if: ${{ !cancelled() && matrix.variant == '' }}
uses: actions/upload-artifact@v4
with:
name: meson-test-logs-${{ matrix.target }}-${{ matrix.build.name }}
path: |
${{ github.workspace }}/build/meson-logs/testlog-*.txt
test-on-macos-13:
runs-on: macos-13 # select an x86_64 image
steps:
- name: install prerequisites
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: brew install meson nasm
- name: git checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: cache rust toolchain
uses: actions/cache@v4
with:
path: |
~/.rustup/toolchains
~/.rustup/update-hashes
~/.rustup/settings.toml
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain', 'rust-toolchain.toml') }}
- name: cache rust crates
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: cargo build for x86_64-apple-darwin
run: |
cargo +stable build --release
- name: meson test for x86_64-apple-darwin
run: |
.github/workflows/test.sh \
-r target/release/dav1d \
-s target/release/seek_stress
- name: copy log files
if: ${{ !cancelled() }}
run: |
cp ${{ github.workspace }}/build/meson-logs/testlog.txt \
${{ github.workspace }}/build/meson-logs/testlog-x86_64-apple-darwin.txt
- name: upload build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: meson-test-logs-x86_64-apple-darwin
path: |
${{ github.workspace }}/build/meson-logs/testlog-*.txt
test-on-windows-2022:
runs-on: windows-2022
steps:
- name: install prerequisites
run: |
choco install nasm
shell: pwsh
- name: add nasm to path
run: |
$nasmPath = "$($env:SystemDrive)\Program Files\NASM"
echo $nasmPath
dir $nasmPath
echo "$nasmPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: check nasm installation
run: nasm -v
- name: git checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: cargo build
run: cargo build --release