Skip to content

Commit

Permalink
try to build release with bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
eustas committed Mar 11, 2024
1 parent cf3bf0a commit 8ddce99
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 5 deletions.
87 changes: 86 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}


windows_build:
windows_vcpkg_build:
name: Windows Build (vcpkg / ${{ matrix.triplet }})
if: ${{ !contains(github.event.pull_request.labels.*.name, 'CI:none') }}
runs-on: [windows-2022]
Expand Down Expand Up @@ -384,3 +384,88 @@ jobs:
with:
files: jxl-${{matrix.triplet}}.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}

windows_bazel_build:
name: Windows Bazel Build
runs-on: [windows-2022]

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit

- name: Checkout the source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true

- name: Patch
shell: 'bash'
run: |
# cd third_party/highway
# git fetch origin 31fbbd7ce1e4179a32d86688cd67316556f582bf
# git checkout 31fbbd7ce1e4179a32d86688cd67316556f582bf
# git apply ${{ github.workspace }}/.github/workflows/highway.patch
- name: Build
shell: 'bash'
run: bazel build -c opt ...:all

- name: Setup tmate session
if: failure()
uses: mxschmitt/action-tmate@a283f9441d2d96eb62436dc46d7014f5d357ac22 # v3.17

windows_cmake_build:
name: Windows CMake Build
runs-on: [windows-2022]

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit

- name: Checkout the source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true

- name: CMake configure
shell: 'bash'
run: |
set -x
choco install ninja pkgconfiglite
export CC=clang
export CXX=clang++
export PREFIX=`pwd`/local
mkdir "${PREFIX}"
cd third_party
cd zlib
cmake -DCMAKE_BUILD_TYPE=Release -B build -G Ninja -DCMAKE_INSTALL_PREFIX=${PREFIX}/zlib
cmake --build build
cmake --install build --prefix "${PREFIX}"/zlib
cd ..
cd libpng
cmake -DCMAKE_BUILD_TYPE=Release -B build -G Ninja -DCMAKE_INSTALL_PREFIX=${PREFIX}/libpng -DCMAKE_PREFIX_PATH=${PREFIX}/zlib
cmake --build build
cmake --install build --prefix "${PREFIX}"/libpng
cd ..
cd googletest
cmake -DCMAKE_BUILD_TYPE=Release -B build -G Ninja -DCMAKE_INSTALL_PREFIX=${PREFIX}/gtest
cmake --build build
cmake --install build --prefix "${PREFIX}"/gtest
cd ..
cd ..
cmake -DCMAKE_BUILD_TYPE=Release -DJPEGXL_ENABLE_JNI=OFF -DJPEGXL_ENABLE_MANPAGES=OFF -DJPEGXL_FORCE_SYSTEM_GTEST=ON -B build -DCMAKE_PREFIX_PATH=${PREFIX}/zlib:${PREFIX}/libpng:${PREFIX}/gtest -G Ninja
- name: CMake build
run: cmake --build build

- name: Setup tmate session
if: failure()
uses: mxschmitt/action-tmate@a283f9441d2d96eb62436dc46d7014f5d357ac22 # v3.17
9 changes: 5 additions & 4 deletions lib/jxl/jxl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,14 @@ TEST(JxlTest, JXL_X86_64_TEST(RoundtripLargeEmptyModular)) {
PackedPixelFile ppf_out;
EXPECT_NEAR(Roundtrip(t.ppf(), cparams, {}, &pool, &ppf_out), 3474795,
100000);
EXPECT_SLIGHTLY_BELOW(ComputeDistance2(t.ppf(), ppf_out),
float expected_d =
#if JXL_HIGH_PRECISION
2050
2050
#else
12100
12100
#endif
);
;
EXPECT_SLIGHTLY_BELOW(ComputeDistance2(t.ppf(), ppf_out), expected_d);
}

TEST(JxlTest, RoundtripOutputColorSpace) {
Expand Down

0 comments on commit 8ddce99

Please sign in to comment.