Skip to content

Commit

Permalink
Move mingw tests from appveyor to github actions (#2838)
Browse files Browse the repository at this point in the history
  • Loading branch information
binhdvo authored Nov 2, 2021
1 parent 04734ee commit b399b47
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 41 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/dev-long-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,59 @@ jobs:
make clean
make -C tests test-fuzzer-stackmode
mingw-long-test:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include: [
{ compiler: clang, platform: x64, action: build, script: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion -Wno-unused-command-line-argument -Wno-implicit-int-float-conversion' make -j allzstd V=1"},
{ compiler: gcc, platform: x64, action: test, script: ""},
]
steps:
- uses: actions/checkout@v2
- name: Mingw long test
run: |
$env:PATH_ORIGINAL = $env:PATH
$env:PATH_MINGW32 = "C:\msys64\mingw32\bin"
$env:PATH_MINGW64 = "C:\msys64\mingw64\bin"
COPY C:\msys64\usr\bin\make.exe C:\msys64\mingw32\bin\make.exe
COPY C:\msys64\usr\bin\make.exe C:\msys64\mingw64\bin\make.exe
IF ("${{matrix.platform}}" -eq "x64")
{
$env:PATH = $env:PATH_MINGW64 + ";" + $env:PATH_ORIGINAL
}
ELSEIF ("${{matrix.platform}}" -eq "x86")
{
$env:PATH = $env:PATH_MINGW32 + ";" + $env:PATH_ORIGINAL
}
IF ("${{matrix.action}}" -eq "build")
{
make -v
sh -c "${{matrix.compiler}} -v"
ECHO "Building zlib to static link"
$env:CC = "${{matrix.compiler}}"
sh -c "cd .. && git clone --depth 1 --branch v1.2.11 https://github.com/madler/zlib"
sh -c "cd ../zlib && make -f win32/Makefile.gcc libz.a"
ECHO "Building zstd"
$env:CPPFLAGS = "-I../../zlib"
$env:LDFLAGS = "../../zlib/libz.a"
sh -c "${{matrix.script}}"
}
ELSEIF ("${{matrix.action}}" -eq "test")
{
ECHO "Testing ${{matrix.compiler}} ${{matrix.platform}}"
$env:CC = "gcc"
$env:CXX = "g++"
MKDIR build\cmake\build
CD build\cmake\build
$env:FUZZERTEST = "-T2mn"
$env:ZSTREAM_TESTTIME = "-T2mn"
cmake -G "Visual Studio 14 2015 Win64" ..
cd ..\..\..
make clean
}
# lasts ~20mn
oss-fuzz:
runs-on: ubuntu-latest
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/dev-short-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,42 @@ jobs:
run: |
LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check
mingw-short-test:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include: [
{ compiler: gcc, platform: x64, script: "CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2"},
{ compiler: gcc, platform: x86, script: "CFLAGS=-Werror make -j allzstd"},
{ compiler: clang, platform: x64, script: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"},
]
steps:
- uses: actions/checkout@v2
- name: Mingw short test
run: |
ECHO "Building ${{matrix.compiler}} ${{matrix.platform}}"
$env:PATH_ORIGINAL = $env:PATH
$env:PATH_MINGW32 = "C:\msys64\mingw32\bin"
$env:PATH_MINGW64 = "C:\msys64\mingw64\bin"
COPY C:\msys64\usr\bin\make.exe C:\msys64\mingw32\bin\make.exe
COPY C:\msys64\usr\bin\make.exe C:\msys64\mingw64\bin\make.exe
IF ("${{matrix.platform}}" -eq "x64")
{
$env:PATH = $env:PATH_MINGW64 + ";" + $env:PATH_ORIGINAL
}
ELSEIF ("${{matrix.platform}}" -eq "x86")
{
$env:PATH = $env:PATH_MINGW32 + ";" + $env:PATH_ORIGINAL
}
make -v
sh -c "${{matrix.compiler}} -v"
$env:CC = "${{matrix.compiler}}"
sh -c "${{matrix.script}}"
ECHO "Testing ${{matrix.compiler}} ${{matrix.platform}}"
make clean
make check
# This test currently fails on Github Actions specifically.
# Possible reason : TTY emulation.
# Note that the same test works fine locally and on travisCI.
Expand Down
42 changes: 1 addition & 41 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@
SCRIPT: "make allzstd MOREFLAGS=-static"
ARTIFACT: "true"
BUILD: "true"
- COMPILER: "clang"
HOST: "mingw"
PLATFORM: "x64"
SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"
BUILD: "true"

- COMPILER: "gcc"
HOST: "mingw"
PLATFORM: "x64"
SCRIPT: ""
TEST: "cmake"

- COMPILER: "visual"
HOST: "visual"
Expand Down Expand Up @@ -201,18 +190,6 @@
- COMPILER: "gcc"
HOST: "cygwin"
PLATFORM: "x64"
- COMPILER: "gcc"
HOST: "mingw"
PLATFORM: "x64"
SCRIPT: "CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2"
- COMPILER: "gcc"
HOST: "mingw"
PLATFORM: "x86"
SCRIPT: "CFLAGS=-Werror make -j allzstd"
- COMPILER: "clang"
HOST: "mingw"
PLATFORM: "x64"
SCRIPT: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"

- COMPILER: "clang-cl"
HOST: "cmake-visual"
Expand All @@ -233,12 +210,6 @@
cmake,^
make
)
- if [%HOST%]==[mingw] (
SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" &&
SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" &&
COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\make.exe &&
COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\make.exe
)

build_script:
- ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION%
Expand All @@ -253,17 +224,6 @@
ctest -V -L Medium;
"
)
- if [%HOST%]==[mingw] (
( if [%PLATFORM%]==[x64] (
SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%"
) else if [%PLATFORM%]==[x86] (
SET "PATH=%PATH_MINGW32%;%PATH_ORIGINAL%"
) ) &&
make -v &&
sh -c "%COMPILER% -v" &&
set "CC=%COMPILER%" &&
sh -c "%SCRIPT%"
)
- if [%HOST%]==[cmake-visual] (
ECHO *** &&
ECHO *** Building %CMAKE_GENERATOR% ^(%CMAKE_GENERATOR_TOOLSET%^) %PLATFORM%\%CONFIGURATION% &&
Expand All @@ -281,4 +241,4 @@
set "CC=%COMPILER%" &&
make clean &&
make check
)
)
1 change: 1 addition & 0 deletions lib/compress/zstd_compress_superblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ static size_t ZSTD_seqDecompressedSize(seqStore_t const* seqStore, const seqDef*
const seqDef* sp = sstart;
size_t matchLengthSum = 0;
size_t litLengthSum = 0;
(void)(litLengthSum); /* suppress unused variable warning on some environments */
while (send-sp > 0) {
ZSTD_sequenceLength const seqLen = ZSTD_getSequenceLength(seqStore, sp);
litLengthSum += seqLen.litLength;
Expand Down

0 comments on commit b399b47

Please sign in to comment.