Small improvements and asserts #23
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
permissions: read-all | |
name: Create release artifacts | |
on: | |
push: | |
tags: | |
- '*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
cmake_ubuntu_x86_64: | |
name: Build x86_64 Linux | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: | |
- name: GCC-12 (C++20) | |
extra_deps: g++-12 | |
c_compiler: gcc-12 | |
cxx_compiler: g++-12 | |
cxx_flags: -ftrapv | |
cxx_standard: 20 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: audit # cannot be block - runner does git checkout | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.0.0 | |
- name: Install deps | |
run: sudo apt-get install ${{ matrix.extra_deps }} git curl | |
- name: Build Clang x86_64 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
export CTEST_PARALLEL_LEVEL=2 | |
git clone --branch widen_mul https://token:${GITHUB_TOKEN}@github.com/awxkee/highway | |
CXXFLAGS=${{ matrix.cxx_flags }} CC=${{ matrix.c_compiler }} CXX=${{ matrix.cxx_compiler }} cmake -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED=ON -B out . | |
cmake --build out | |
cp ./out/libsparkyuv.so libsparkyuv.so | |
- name: Compress GCC x86_64 build | |
uses: a7ul/tar-action@v1.1.0 | |
id: compress | |
with: | |
command: c | |
files: | | |
libsparkyuv.so | |
include | |
outPath: libsparkyuv.linux-x86_64.tar.gz | |
- name: Upload built library | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-x86_64 | |
with: | |
name: libsparkyuv.linux-x86_64.tar.gz | |
path: libsparkyuv.linux-x86_64.tar.gz | |
gcc_ubuntu_arm64: | |
name: Build ARM64 Linux | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- arch: aarch64 | |
distro: ubuntu_latest | |
cxx_flags: -Wno-psabi | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build and test | |
uses: uraimo/run-on-arch-action@v2.7.1 | |
id: build | |
with: | |
arch: ${{ matrix.arch }} | |
distro: ${{ matrix.distro }} | |
# Not required, but speeds up builds | |
githubToken: ${{ github.token }} | |
env: | | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
setup: | | |
mkdir -p "${PWD}/artifacts" | |
dockerRunArgs: | | |
--volume "${PWD}/artifacts:/artifacts" | |
install: | | |
apt-get update -q -y | |
apt-get install -q -y --no-install-recommends \ | |
build-essential \ | |
cmake \ | |
ninja-build \ | |
git curl \ | |
; | |
apt-get reinstall -y ca-certificates | |
update-ca-certificates | |
run: | | |
export GIT_SSL_NO_VERIFY=1 | |
git config --global http.sslverify false | |
git clone --branch widen_mul https://token:${GITHUB_TOKEN}@github.com/awxkee/highway | |
export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
export CTEST_PARALLEL_LEVEL=2 | |
CXXFLAGS=${{ matrix.cxx_flags }} cmake -GNinja ${{ matrix.cmake_flags }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED=ON -B out . | |
cmake --build out | |
rm -rf libsparkyuv.so | |
cp ./out/libsparkyuv.so libsparkyuv.so | |
tar -cf libsparkyuv.linux-${{ matrix.arch }}.tar.gz libsparkyuv.so include | |
cp libsparkyuv.linux-${{ matrix.arch }}.tar.gz "/artifacts/libsparkyuv.linux-${{ matrix.arch }}.tar.gz" | |
- name: Upload built library | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-aarch64 | |
with: | |
name: libsparkyuv.linux-aarch64.tar.gz | |
path: libsparkyuv.linux-aarch64.tar.gz | |
android_build: | |
name: Build Android | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: audit # cannot be block - runner does git checkout | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.0.0 | |
- name: Install deps | |
run: sudo apt-get install git ninja-build | |
- uses: nttld/setup-ndk@v1 | |
id: setup-ndk | |
with: | |
ndk-version: r26d | |
add-to-path: true | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: | | |
export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
export CTEST_PARALLEL_LEVEL=2 | |
git clone --branch widen_mul https://token:${GITHUB_TOKEN}@github.com/awxkee/highway | |
bash toolchain/ci_android_runner.sh | |
echo "Creating arm64-v8a Package" | |
cp build-arm64-v8a/libsparkyuv.a libsparkyuv.a | |
tar -cf libsparkyuv.android-arm64-v8a-static.tar.gz libsparkyuv.a include | |
rm -rf libsparkyuv.a | |
echo "Creating armeabi-v7a Package" | |
cp build-armeabi-v7a/libsparkyuv.a libsparkyuv.a | |
tar -cf libsparkyuv.android-armeabi-v7a-static.tar.gz libsparkyuv.a include | |
rm -rf libsparkyuv.a | |
echo "Creating x86 Package" | |
cp build-x86/libsparkyuv.a libsparkyuv.a | |
tar -cf libsparkyuv.android-x86-static.tar.gz libsparkyuv.a include | |
rm -rf libsparkyuv.a | |
echo "Creating x86_64 Package" | |
cp build-x86_64/libsparkyuv.a libsparkyuv.a | |
tar -cf libsparkyuv.android-x86_64-static.tar.gz libsparkyuv.a include | |
- name: Upload built library ARM64-v8a | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-arm64-v8a | |
with: | |
name: libsparkyuv.android-arm64-v8-static.tar.gz | |
path: libsparkyuv.android-arm64-v8a-static.tar.gz | |
- name: Upload built library Armeabi-v7a | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-armeabi-v7a | |
with: | |
name: libsparkyuv.android-armeabi-v7a-static.tar.gz | |
path: libsparkyuv.android-armeabi-v7a-static.tar.gz | |
- name: Upload built library x86 | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-x86 | |
with: | |
name: libsparkyuv.android-x86-static.tar.gz | |
path: libsparkyuv.android-x86-static.tar.gz | |
- name: Upload built library x86_64 | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-x86_64 | |
with: | |
name: libsparkyuv.android-x86_64-static.tar.gz | |
path: libsparkyuv.android-x86_64-static.tar.gz | |
build_release_graviton: | |
name: Build Graviton | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: | |
- arch: aarch64 | |
distro: ubuntu_latest | |
cxx_flags: -Wno-psabi | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: audit # cannot be block - runner does git checkout | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.0.0 | |
- name: Build and test | |
uses: uraimo/run-on-arch-action@v2.7.1 | |
id: build | |
with: | |
arch: ${{ matrix.arch }} | |
distro: ${{ matrix.distro }} | |
# Not required, but speeds up builds | |
githubToken: ${{ github.token }} | |
setup: | | |
mkdir -p "${PWD}/artifacts" | |
dockerRunArgs: | | |
--volume "${PWD}/artifacts:/artifacts" | |
env: | | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
install: | | |
apt-get update -q -y | |
apt-get install -q -y --no-install-recommends \ | |
build-essential \ | |
cmake \ | |
ninja-build clang-15 \ | |
git \ | |
; | |
apt-get reinstall -y ca-certificates | |
update-ca-certificates | |
run: | | |
export GIT_SSL_NO_VERIFY=1 | |
git config --global http.sslverify false | |
git clone --branch widen_mul https://token:${GITHUB_TOKEN}@github.com/awxkee/highway | |
export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
export CTEST_PARALLEL_LEVEL=2 | |
cmake -G "Ninja" \ | |
-DCMAKE_TOOLCHAIN_FILE=toolchain/graviton.cmake \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DBUILD_SHARED=ON \ | |
-B out . | |
ninja -j 8 -C out | |
ctest --test-dir out | |
cp out/libsparkyuv.so libsparkyuv.so | |
tar -cf libsparkyuv.linux-graviton-v2.tar.gz libsparkyuv.so include | |
cp libsparkyuv.linux-graviton-v2.tar.gz "/artifacts/libsparkyuv.linux-graviton-v2.tar.gz" | |
- name: Upload built graviton library | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-graviton-v2 | |
with: | |
name: libsparkyuv.linux-graviton-v2.tar.gz | |
path: libsparkyuv.linux-graviton-v2.tar.gz | |
make_windows_x86_64: | |
name: Build x86_64 Windows | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ windows-latest ] | |
build_type: [ Release ] | |
c_compiler: [ cl ] | |
include: | |
- os: windows-latest | |
c_compiler: cl | |
cpp_compiler: cl | |
steps: | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.0.0 | |
- name: Set reusable strings | |
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=out" >> "$GITHUB_OUTPUT" | |
- name: Build and test | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git clone --branch widen_mul https://token:${GITHUB_TOKEN}@github.com/awxkee/highway | |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED=ON -B ${{ steps.strings.outputs.build-output-dir }} -S . | |
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release | |
ctest --test-dir out | |
cp out/Release/sparkyuv.dll sparkyuv.dll | |
- name: Compress MSVC x86_64 build | |
uses: a7ul/tar-action@v1.1.0 | |
id: compress | |
with: | |
command: c | |
files: | | |
sparkyuv.dll | |
include | |
outPath: libsparkyuv.windows-x86_64.tar.gz | |
- name: Upload built graviton library | |
uses: actions/upload-artifact@v4 | |
id: artifact-windows-x86_64 | |
with: | |
name: libsparkyuv.windows-x86_64.tar.gz | |
path: libsparkyuv.windows-x86_64.tar.gz | |
create_release: | |
name: Create and upload release | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
needs: | |
- gcc_ubuntu_arm64 | |
- cmake_ubuntu_x86_64 | |
- android_build | |
- build_release_graviton | |
- make_windows_x86_64 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Compress Sources | |
uses: a7ul/tar-action@v1.1.0 | |
id: compress | |
with: | |
command: c | |
files: | | |
../sparkyuv | |
outPath: sparkyuv.tar.gz | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- run: ls -la | |
- uses: ncipollo/release-action@v1 | |
with: | |
bodyFile: 'CHANGELOG.md' | |
artifacts: "sparkyuv.tar.gz,libsparkyuv.linux-*.tar.gz,libsparkyuv.android-*.tar.gz,libsparkyuv.windows-*.tar.gz" |