Skip to content

Commit

Permalink
upload full testdata archive
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 565017690
  • Loading branch information
eustas authored and copybara-github committed Sep 13, 2023
1 parent 63402aa commit ce9c16e
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ python/** !export-ignore

# Add more build files.
scripts !export-ignore
scripts/download_testdata.sh !export-ignore
scripts/libbrotli*.pc.in !export-ignore

# Add testdata
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,39 +357,3 @@ jobs:
python -VV
python -c "import sys; sys.exit('Invalid python version') if '.'.join(map(str,sys.version_info[0:2])) != '${{ matrix.python_version }}' else True"
python setup.py ${{ matrix.py_setuptools_cmd || 'test'}}
archive_build:
name: Build and test from archive
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: Archive
run: |
git archive HEAD -o archive.tgz
- name: Extract
run: |
mkdir archive
cd archive
tar xvzf ../archive.tgz
- name: Configure and Build
run: |
cd archive
cmake -B out .
cmake --build out
- name: Test
run: |
cd archive
cd out
ctest
71 changes: 70 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,73 @@ jobs:
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: brotli-${{matrix.triplet}}.zip
tag_name: dev/null

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'
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: testdata.txz

archive_build:
needs: testdata_upload
name: Build and test from archive
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: Archive
run: |
git archive HEAD -o archive.tgz
- name: Pick tag
run: |
echo "BROTLI_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Extract
run: |
mkdir archive
cd archive
tar xvzf ../archive.tgz
- name: Download testdata
run: |
cd archive
scripts/download_testdata.sh
- name: Configure and Build
run: |
cd archive
cmake -B out .
cmake --build out
- name: Test
run: |
cd archive
cd out
ctest
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ if(NOT BROTLI_DISABLE_TESTS)
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/run-roundtrip-test.cmake)
endforeach()
else()
message(NOTICE "Test file ${INPUT} does not exist; OK on tarball builds")
message(NOTICE "Test file ${INPUT} does not exist; OK on tarball builds; consider running scripts/download_testdata.sh before configuring.")
endif()
endforeach()

Expand Down
7 changes: 7 additions & 0 deletions scripts/download_testdata.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -x
BROTLI_TAG=${BROTLI_TAG:-dev/null}
BROTLI_TAG="${BROTLI_TAG//'/'/%2F}" # Escaping for tag names with slash (e.g. "dev/null")
ARCHIVE=testdata.txz
curl -L https://github.com/google/brotli/releases/download/${BROTLI_TAG}/${ARCHIVE} -o ${ARCHIVE}
tar xvfJ ${ARCHIVE}

0 comments on commit ce9c16e

Please sign in to comment.