Skip to content

Commit

Permalink
upload full testdata archive
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 564700547
  • Loading branch information
eustas authored and copybara-github committed Sep 12, 2023
1 parent 63402aa commit 40f1ea3
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ jobs:
- name: Configure and Build
run: |
cd archive
cmake -B out .
cmake -B out . -DBROTLI_DOWNLOAD_TESTDATA=ON
cmake --build out
- name: Test
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,28 @@ jobs:
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: brotli-${{matrix.triplet}}.zip

testdata_upload:
name: Upload testdata
runs-on: 'ubuntu-latest'
defaults:
run:
shell: bash
steps:

- name: Checkout the source
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
submodules: false
fetch-depth: 1

- name: Compress testdata
run: |
tar cvfJ testdata.txz tests/testdata
- name: Upload archive to release
if: (github.event_name == 'release') || true
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: testdata.txz
tag_name: dev/null
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ cmake_policy(SET CMP0048 NEW)
project(brotli C)

option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_DISABLE_TESTS "Disable tests" OFF)
option(BUILD_DOWNLOAD_TESTDATA "Download full testdata" OFF)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to Release as none was specified.")
Expand Down Expand Up @@ -233,6 +235,10 @@ if(NOT BROTLI_DISABLE_TESTS)
include(CTest)
enable_testing()

if(BROTLI_DOWNLOAD_TESTDATA)
add_custom_target(download_testdata scripts/download_testdata.sh)
endif()

set(ROUNDTRIP_INPUTS
tests/testdata/alice29.txt
tests/testdata/asyoulik.txt
Expand Down
6 changes: 6 additions & 0 deletions scripts/download_testdata.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
TAG=`git describe --tags --abbrev=0`
TAG="${TAG//'/'/%2F}" # Escaping for tag names with slash (e.g. "dev/null")
ARCHIVE=testdata.txz
curl https://github.com/google/brotli/releases/download/${TAG}/${ARCHIVE} --output ${ARCHIVE}
tar xvfJ ${ARCHIVE}

0 comments on commit 40f1ea3

Please sign in to comment.