Skip to content

JlCompress UTF-8 support, encryption, fluent interface #28

JlCompress UTF-8 support, encryption, fluent interface

JlCompress UTF-8 support, encryption, fluent interface #28

Workflow file for this run

on:
push:
branches:
- master
- feature/*
pull_request:
workflow_dispatch:
name: UTF-8 Filename Tests
permissions: read-all
env:
BUILD_TYPE: Release
jobs:
# Compression job - creates UTF-8 archives with UTF-8 locale
utf8-compress:
if: true
runs-on: ubuntu-22.04
name: utf8-compress-Qt-${{ matrix.qt_version }}
container: ghcr.io/cen1/qt:${{ matrix.qt_version }}
strategy:
fail-fast: false
matrix:
qt_version: [ 5.15.12, 6.4.3, 6.8.2 ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DBUILD_SHARED_LIBS=OFF -DQUAZIP_ENABLE_TESTS=ON -DQUAZIP_USE_QT_ZLIB=ON -DCMAKE_PREFIX_PATH="/usr/local/Qt-${{ matrix.qt_version }}" -B build
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Run UTF-8 compression tests
working-directory: build
env:
LC_ALL: C.UTF-8
LANG: C.UTF-8
TEST_UTF8_COMPRESS: "true"
run: ctest --verbose -C Release
- name: Upload UTF-8 archives to GitHub Actions Storage
uses: actions/upload-artifact@v4
with:
retention-days: 1
overwrite: true
name: "utf8_archives_qt${{ matrix.qt_version }}"
path: build/quazip/utf8_*.zip
# Compression job with C locale - demonstrates filename mangling when UTF-8 flag is not used
utf8-compress-bad:
if: true
runs-on: ubuntu-22.04
name: utf8-compress-bad-Qt-${{ matrix.qt_version }}
container: ghcr.io/cen1/qt:${{ matrix.qt_version }}
strategy:
fail-fast: false
matrix:
qt_version: [ 5.15.12, 6.8.2 ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DBUILD_SHARED_LIBS=OFF -DQUAZIP_ENABLE_TESTS=ON -DQUAZIP_USE_QT_ZLIB=ON -DCMAKE_PREFIX_PATH="/usr/local/Qt-${{ matrix.qt_version }}" -B build
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Compress UTF-8 filenames WITHOUT UTF-8 flag in C locale
working-directory: build
env:
LC_ALL: C
LANG: C
TEST_UTF8_COMPRESS: "true"
TEST_UTF8_COMPRESS_BAD: "true"
run: ctest --verbose -C Release
# Compression job with Latin1 locale - demonstrates '?' replacement vs character dropping
utf8-compress-bad-latin1:
if: true
runs-on: ubuntu-22.04
name: utf8-compress-bad-latin1-Qt-${{ matrix.qt_version }}
container: ghcr.io/cen1/qt:${{ matrix.qt_version }}
strategy:
fail-fast: false
matrix:
qt_version: [ 5.15.12 ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DBUILD_SHARED_LIBS=OFF -DQUAZIP_ENABLE_TESTS=ON -DQUAZIP_USE_QT_ZLIB=ON -DCMAKE_PREFIX_PATH="/usr/local/Qt-${{ matrix.qt_version }}" -B build
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Setup Latin-1 locale
run: |
apt-get update
apt-get install -y locales
echo "de_DE ISO-8859-1" | tee -a /etc/locale.gen
locale-gen
- name: Compress UTF-8 filenames WITHOUT UTF-8 flag in Latin1 locale
working-directory: build
env:
LC_ALL: de_DE ISO-8859-1
LANG: de_DE ISO-8859-1
TEST_UTF8_COMPRESS: "true"
TEST_UTF8_COMPRESS_BAD: "true"
run: ctest --verbose -C Release
utf8-compress-bad-win-x64:
name: Win-Qt-${{ matrix.qt_version }}-preset-${{ matrix.preset }}
strategy:
fail-fast: false
matrix:
preset: [ conan ]
qt_version: [ 5.15.2, 6.8.2 ]
uses: ./.github/workflows/reusable-win.yml
with:
runs_on: "win-x64"
arch: x64
qt_version: ${{ matrix.qt_version }}
preset: ${{ matrix.preset }}
pe_str: "x86-64"
test_utf8_compress: true
test_utf8_compress_bad: true
# Decompression job - extracts UTF-8 archives with C locale, expects mangled output
utf8-decompress:
if: true
runs-on: ubuntu-22.04
name: utf8-decompress-Qt-${{ matrix.qt_version }}
container: ghcr.io/cen1/qt:${{ matrix.qt_version }}
needs: [ utf8-compress ]
strategy:
fail-fast: false
matrix:
qt_version: [ 5.15.12, 6.4.3, 6.8.2 ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DBUILD_SHARED_LIBS=OFF -DQUAZIP_ENABLE_TESTS=ON -DQUAZIP_USE_QT_ZLIB=ON -DCMAKE_PREFIX_PATH="/usr/local/Qt-${{ matrix.qt_version }}" -B build
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Download UTF-8 archives
uses: actions/download-artifact@v4
with:
path: build/quazip
merge-multiple: false
- name: Run UTF-8 decompression tests
working-directory: build
env:
LC_ALL: C
LANG: C
TEST_UTF8_DECOMPRESS: "true"
run: ctest --verbose -C Release