Build for macos x86_64 and arm64 #40
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Compilation test" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: debian:bookworm | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install prerequisites | |
timeout-minutes: 10 | |
run: | | |
apt-get -qq update | |
apt-get -qq install -y build-essential perl | |
- name: attempt compilation w/o asan | |
timeout-minutes: 2 | |
run: | | |
NO_ASAN=1 make -B ansi2html | |
- name: attempt compilation with asan | |
timeout-minutes: 2 | |
run: | | |
make clean | |
make -B ansi2html | |
- name: test minimal conversion | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html -p vga | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html -b -p vga | |
echo | |
- name: run tests | |
timeout-minutes: 1 | |
run: | | |
make run-tests | |
build-static: | |
runs-on: ubuntu-latest | |
container: alpine:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install prerequisites | |
timeout-minutes: 10 | |
run: | | |
apk add --no-cache clang musl-dev binutils xz nodejs bash perl perl-utils mingw-w64-gcc | |
- name: static compilation [no iTerm2 palettes] with clang/musl | |
timeout-minutes: 2 | |
run: | | |
clang -O2 -o ansi2html-noi2 -flto -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c | |
- name: static compilation [with iTerm2 palettes] with clang/musl | |
timeout-minutes: 2 | |
run: | | |
clang -O2 -DITERM2_COLOR_SCHEMES -o ansi2html -flto -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c src/iterm2_color_schemes/ansi_color_palette.c | |
- name: test minimal conversion [no iTerm2 palettes] | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html-noi2 -p vga | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html-noi2 -b -p vga | |
echo | |
- name: test minimal conversion [with iTerm2 palettes] | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html -p i2_laser | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html -b -p i2_laser | |
echo | |
- name: run tests [with iTerm2 palettes] | |
timeout-minutes: 1 | |
run: | | |
prove -v tests/*.sh | |
- name: static compilation [no iTerm2 palettes] with mingw32-w64 | |
timeout-minutes: 2 | |
run: | | |
x86_64-w64-mingw32-cc -O2 -flto -o ansi2html-noi2.exe -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c | |
- name: static compilation [with iTerm2 palettes] with mingw32-w64 | |
timeout-minutes: 2 | |
run: | | |
x86_64-w64-mingw32-cc -O2 -DITERM2_COLOR_SCHEMES -flto -o ansi2html.exe -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c src/iterm2_color_schemes/ansi_color_palette.c | |
- name: compress binaries | |
timeout-minutes: 1 | |
run: | | |
xz --compress --stdout ansi2html > ansi2html-Linux-x86_64-musl.xz | |
xz --compress --stdout ansi2html-noi2 > ansi2html-noi2-Linux-x86_64-musl.xz | |
xz --compress --stdout ansi2html-noi2.exe > ansi2html-noi2-Windows-x86_64-mingw32.xz | |
xz --compress --stdout ansi2html.exe > ansi2html-Windows-x86_64-mingw32.xz | |
- name: show sizes | |
timeout-minutes: 1 | |
run: | | |
ls -laS ansi2html* | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
arch: [x86_64, arm64] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Build and compress for ${{matrix.arch}} [no iTerm2 palettes]" | |
timeout-minutes: 2 | |
run: | | |
clang -O2 -target ${{matrix.arch}}-apple-darwin -o ansi2html-noi2 -flto -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c | |
- name: "Test minimal conversion for ${{matrix.arch}} [no iTerm2 palettes]" | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html-noi2 -p vga | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html-noi2 -b -p vga | |
echo | |
- name: "Compress for ${{matrix.arch}} [no iTerm2 palettes]" | |
timeout-minutes: 1 | |
run: | | |
xz --compress --stdout ansi2html-noi2 > ansi2html-noi2-apple-darwin-${{matrix.arch}} | |
cp ansi2html-noi2 ansi2html-noi2-apple-darwin-${{matrix.arch}} | |
- name: "Build for ${{matrix.arch}} [with iTerm2 palettes]" | |
timeout-minutes: 2 | |
run: | | |
clang -O2 -DITERM2_COLOR_SCHEMES -target ${{matrix.arch}}-apple-darwin -o ansi2html -flto -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c src/iterm2_color_schemes/ansi_color_palette.c | |
- name: "Test minimal conversion for ${{matrix.arch}} [with iTerm2 palettes]" | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html -p vga | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html -b -p vga | |
echo | |
- name: "Compress for ${{matrix.arch}} [with iTerm2 palettes]" | |
timeout-minutes: 1 | |
run: | | |
xz --compress --stdout ansi2html > ansi2html-apple-darwin-${{matrix.arch}} | |
cp ansi2html ansi2html-apple-darwin-${{matrix.arch}} | |
- name: show sizes | |
timeout-minutes: 1 | |
run: | | |
ls -laS ansi2html* |