-
Notifications
You must be signed in to change notification settings - Fork 22
151 lines (134 loc) · 4.81 KB
/
macos-x86_64.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: macos-x86_64
on:
pull_request:
paths-ignore:
- '*.md'
- '**/*.md'
- 'LICENSE*'
- 'examples/**'
- 'nerves/**'
- 'Makefile.win'
- 'cc_toolchain/**'
- 'checksum.exs'
- '.github/FUNDING.yml'
- '.github/workflows/nerves-*.yml'
- '.github/workflows/linux-*.yml'
- '.github/workflows/windows-*.yml'
- '.github/workflows/test-*.yml'
- '.github/workflows/macos-precompile.yml'
- '.github/*manylinux*.sh'
push:
branches:
- main
- test-*
paths-ignore:
- '*.md'
- '**/*.md'
- 'LICENSE*'
- 'examples/**'
- 'nerves/**'
- 'Makefile.win'
- 'cc_toolchain/**'
- 'checksum.exs'
- '.github/FUNDING.yml'
- '.github/workflows/nerves-*.yml'
- '.github/workflows/linux-*.yml'
- '.github/workflows/windows-*.yml'
- '.github/workflows/test-*.yml'
- '.github/workflows/macos-precompile.yml'
- '.github/*manylinux*.sh'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mix_test:
runs-on: macos-12
env:
OPENCV_VER: "4.9.0"
MIX_ENV: "test"
EVISION_PREFER_PRECOMPILED: "false"
FFMPEG_VER: "5"
OTP_VERSION: "25.3.2.2"
ELIXIR_VERSION: "1.15.2"
steps:
- uses: actions/checkout@v3
- name: Install FFmpeg, Erlang and Elixir
run: |
brew install autoconf coreutils curl git openssl wxwidgets asdf ffmpeg
brew link ffmpeg
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"
asdf install erlang ${{ env.OTP_VERSION }}
asdf install elixir ${{ env.ELIXIR_VERSION }}
asdf global erlang ${{ env.OTP_VERSION }}
asdf global elixir ${{ env.ELIXIR_VERSION }}
source $(brew --prefix asdf)/libexec/asdf.sh
mix local.hex --force
mix local.rebar --force
- name: Cache mix packages
id: cache-mix-deps
uses: actions/cache@v3
with:
key: deps-${{ hashFiles('mix.lock') }}
path: |
./deps
- name: Get mix deps
if: steps.cache-mix-deps.outputs.cache-hit != 'true'
run: |
source $(brew --prefix asdf)/libexec/asdf.sh
mix deps.get
- name: Cache OpenCV source code
id: cache-opencv
uses: actions/cache@v3
with:
key: opencv-with-contrib-${{ env.OPENCV_VER }}
path: |
./3rd_party
- name: Download OpenCV source code
if: steps.cache-opencv.outputs.cache-hit != 'true'
run: |
bash scripts/download_opencv.sh ${OPENCV_VER} 3rd_party/cache 3rd_party/opencv/
bash scripts/download_opencv_contrib.sh ${OPENCV_VER} 3rd_party/cache 3rd_party/opencv/
- name: Cache compiled OpenCV
id: cache-mix-compile_opencv
uses: actions/cache@v3
with:
key: compiled-with-ffmpeg${{ env.FFMPEG_VER }}-opencv-${{ env.OPENCV_VER }}-x86_64-apple-darwin-${{ hashFiles('Makefile') }}-${{ hashFiles('py_src/*.py') }}
path: |
./_build/${{ env.MIX_ENV }}/lib/evision
./c_src/headers.txt
./c_src/configuration.private.hpp
- name: Compile OpenCV
if: steps.cache-mix-compile_opencv.outputs.cache-hit != 'true'
run: |
source $(brew --prefix asdf)/libexec/asdf.sh
mix compile_opencv
- name: Mix Compile
run: |
source $(brew --prefix asdf)/libexec/asdf.sh
rm -f _build/test/lib/evision/priv/evision.so
rm -rf lib/generated && rm -rf src/generated
mkdir -p lib/generated && mkdir -p src/generated
mix compile
- name: Compile once again but without optional deps
run: |
source $(brew --prefix asdf)/libexec/asdf.sh
mix compile --force --no-optional-deps
- name: Cache testdata
id: cache-mix-testdata
uses: actions/cache@v3
with:
key: testdata-${{ hashFiles('test/downloading_list.txt') }}
path: |
./test/testdata
- name: Mix Test
run: |
# ulimit -c unlimited
# /usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow bool true" tmp.entitlements
# sudo touch /cores/test
# export ERL_BASE="$(dirname $(dirname $(which erl)))"
# export BEAM_SMP="$(find "${ERL_BASE}" -name beam.smp)"
# codesign -s - -f --entitlements tmp.entitlements "${BEAM_SMP}"
source $(brew --prefix asdf)/libexec/asdf.sh
find ./test -name '*_test.exs' -exec bash -c "echo {} && mix test --include require_downloading --include require_ffmpeg {}" \;