Skip to content

Commit

Permalink
WIP Run CI on more OSes and Archs
Browse files Browse the repository at this point in the history
  • Loading branch information
mickel8 committed Jul 27, 2024
1 parent f7b99ff commit 14977d6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: push
jobs:
lint:
runs-on: ubuntu-latest
name: lint OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
name: lint / ubuntu-latest / OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
matrix:
otp: ['25']
Expand All @@ -22,12 +22,13 @@ jobs:
- run: mix docs 2>&1 | (! grep -q "warning:")

test-linux:
runs-on: ubuntu-latest
name: test-linux-x86-64 OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
matrix:
os: ['ubuntu-24.04', 'ubuntu-22.04']
otp: ['25']
elixir: ['1.14']
runs-on: ${{ matrix.os }}
name: test-linux-x86-64 / ${{ matrix.os }} / OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
env:
MIX_ENV: test
steps:
Expand All @@ -41,12 +42,24 @@ jobs:
- run: mix test

test-macos:
runs-on: macos-latest
name: test-macos-x86-64 OTP latest / Elixir latest
runs-on: macos-13
name: test-macos-x86-64 / macos-13 / OTP latest / Elixir latest
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v2
- run: brew install ffmpeg elixir
- run: mix deps.get
- run: mix test

test-macos-arm:
runs-on: macos-14
name: test-macos-arm / macos-14 / OTP latest / Elixir latest
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v2
- run: brew install ffmpeg elixir
- run: mix deps.get
- run: mix test

13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@ XAV_SO = $(PRIV_DIR)/libxav.so
HEADERS = $(XAV_DIR)/reader.h $(XAV_DIR)/decoder.h $(XAV_DIR)/utils.h
SOURCES = $(XAV_DIR)/xav_nif.c $(XAV_DIR)/reader.c $(XAV_DIR)/decoder.c $(XAV_DIR)/utils.c

CFLAGS = -fPIC -I$(ERTS_INCLUDE_DIR) -I${XAV_DIR} -shared $(XAV_DEBUG_LOGS)
CFLAGS = $(XAV_DEBUG_LOGS) -fPIC -shared
IFLAGS = -I$(ERTS_INCLUDE_DIR) -I$(XAV_DIR)
LDFLAGS = -lavcodec -lswscale -lavutil -lavformat -lavdevice -lswresample

ifeq ($(shell uname -s),Darwin)
CFLAGS += -undefined dynamic_lookup
ifeq ($(shell uname -m),arm64)
IFLAGS += $$(pkg-config --cflags-only-I libavcodec libswscale libavutil libavformat libavdevice libswresample)
LFLAGS += $$(pkg-config --libs-only-L libavcodec libswscale libavutil libavformat libavdevice libswresample)
CFLAGS += -undefined dynamic_lookup
else
CFLAGS += -undefined dynamic_lookup
endif
endif

$(XAV_SO): Makefile $(SOURCES) $(HEADERS)
mkdir -p $(PRIV_DIR)
$(CC) $(CFLAGS) $(SOURCES) -o $(XAV_SO) $(LDFLAGS)
$(CC) $(CFLAGS) $(IFLAGS) $(LFLAGS) $(SOURCES) -o $(XAV_SO) $(LDFLAGS)

format:
clang-format -i $(XAV_DIR)/*
Expand Down

0 comments on commit 14977d6

Please sign in to comment.