Skip to content

Commit

Permalink
Use GitHub Actions as CI service (#5602)
Browse files Browse the repository at this point in the history
* ci: migrate to GitHub Actions

* ci: linux-mingw: use lief for parsing PE files

* ci: fix left-over issues with clang-format check

* ci: workaround libc++ issue on macOS

* appveyor: remove build scripts

* README: add GitHub Actions badge and ...

remove Travis CI and Appveyor badges
  • Loading branch information
liushuyu authored Nov 12, 2020
1 parent 2e0ce86 commit 0133ebe
Show file tree
Hide file tree
Showing 47 changed files with 244 additions and 420 deletions.
39 changes: 0 additions & 39 deletions .appveyor/FindDependencies.ps1

This file was deleted.

39 changes: 0 additions & 39 deletions .appveyor/ProcessPdb.ps1

This file was deleted.

4 changes: 2 additions & 2 deletions .travis/common/post-upload.sh → .ci/common/post-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ cp -r dist/scripting "$REV_NAME"
tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME"

# Find out what release we are building
if [ -z $TRAVIS_TAG ]; then
if [ -z $GIT_TAG_NAME ]; then
RELEASE_NAME=head
else
RELEASE_NAME=$(echo $TRAVIS_TAG | cut -d- -f1)
RELEASE_NAME=$(echo $GIT_TAG_NAME | cut -d- -f1)
if [ "$NAME" = "MinGW build" ]; then
RELEASE_NAME="${RELEASE_NAME}-mingw"
fi
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions .ci/linux-clang-format/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash -ex

# Run clang-format
./.ci/linux-clang-format/script.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ex

if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .travis* dist/*.desktop \
if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \
dist/*.svg dist/*.xml; then
echo Trailing whitespace found, aborting
exit 1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions .travis/linux/docker.sh → .ci/linux-fresh/docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash -ex

cd /citra

mkdir build && cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON
ninja
Expand Down
4 changes: 2 additions & 2 deletions .travis/linux/upload.sh → .ci/linux-fresh/upload.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ex

. .travis/common/pre-upload.sh
. .ci/common/pre-upload.sh

REV_NAME="citra-linux-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.xz"
Expand All @@ -16,4 +16,4 @@ cp build/bin/Release/citra-qt "$REV_NAME"
mkdir "$REV_NAME/dist"
cp dist/icon.png "$REV_NAME/dist/citra.png"

. .travis/common/post-upload.sh
. .ci/common/post-upload.sh
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ chmod a+x ~/bin/gold/ld
export CFLAGS="-B$HOME/bin/gold $CFLAGS"
export CXXFLAGS="-B$HOME/bin/gold $CXXFLAGS"

cd /citra

mkdir build && cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions .travis/linux-mingw/docker.sh → .ci/linux-mingw/docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -ex

cd /citra
# override Travis CI unreasonable ccache size
# override CI ccache size
mkdir -p "$HOME/.ccache/"
echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf"

mkdir build && cd build
Expand All @@ -27,4 +27,4 @@ cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/
cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/
rm -f package/mediaservice/*d.dll

python3 .travis/linux-mingw/scan_dll.py package/*.exe package/imageformats/*.dll "package/"
python3 .ci/linux-mingw/scan_dll.py package/*.exe package/imageformats/*.dll "package/"
18 changes: 17 additions & 1 deletion .travis/linux-mingw/scan_dll.py → .ci/linux-mingw/scan_dll.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import pefile
try:
import lief
except ImportError:
import pefile
import sys
import re
import os
Expand All @@ -19,7 +22,20 @@
missing = []


def parse_imports_lief(filename):
results = []
pe = lief.parse(filename)
for entry in pe.imports:
name = entry.name
if name.upper() not in KNOWN_SYS_DLLS and not re.match(string=name, pattern=r'.*32\.DLL'):
results.append(name)
return results


def parse_imports(file_name):
if globals().get('lief'):
return parse_imports_lief(file_name)

results = []
pe = pefile.PE(file_name, fast_load=True)
pe.parse_data_directories()
Expand Down
4 changes: 2 additions & 2 deletions .travis/linux-mingw/upload.sh → .ci/linux-mingw/upload.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ex

. .travis/common/pre-upload.sh
. .ci/common/pre-upload.sh

REV_NAME="citra-windows-mingw-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.gz"
Expand All @@ -10,4 +10,4 @@ mkdir "$REV_NAME"
# get around the permission issues
cp -r package/* "$REV_NAME"

. .travis/common/post-upload.sh
. .ci/common/post-upload.sh
24 changes: 24 additions & 0 deletions .ci/macos/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -ex

set -o pipefail

export Qt5_DIR=$(brew --prefix)/opt/qt5
export PATH="/usr/local/opt/ccache/libexec:/usr/local/opt/llvm/bin:$PATH"
# ccache configurations
export CCACHE_CPP2=yes
export CCACHE_SLOPPINESS=time_macros

export CC="ccache clang"
export CXX="ccache clang++"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"

ccache -s

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_FFMPEG_AUDIO_DECODER=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON -GNinja
ninja

ccache -s

ctest -VV -C Release
6 changes: 6 additions & 0 deletions .ci/macos/deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh -ex

brew update
brew unlink python@2 || true
brew install qt5 sdl2 p7zip ccache ffmpeg llvm ninja
pip3 install macpack
10 changes: 7 additions & 3 deletions .travis/macos/upload.sh → .ci/macos/upload.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ex

. .travis/common/pre-upload.sh
. .ci/common/pre-upload.sh

REV_NAME="citra-osx-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.gz"
Expand All @@ -20,10 +20,14 @@ $(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/citra-qt.app" -executable=
# move libs into folder for deployment
macpack "${REV_NAME}/citra" -d "libs"

# workaround for libc++
install_name_tool -change @loader_path/../Frameworks/libc++.1.0.dylib /usr/lib/libc++.1.dylib "${REV_NAME}/citra-qt.app/Contents/MacOS/citra-qt"
install_name_tool -change @loader_path/libs/libc++.1.0.dylib /usr/lib/libc++.1.dylib "${REV_NAME}/citra"

# Make the launching script executable
chmod +x ${REV_NAME}/citra-qt.app/Contents/MacOS/citra-qt

# Verify loader instructions
find "$REV_NAME" -exec otool -L {} \;
find "$REV_NAME" -type f -exec otool -L {} \;

. .travis/common/post-upload.sh
. .ci/common/post-upload.sh
File renamed without changes.
1 change: 0 additions & 1 deletion .travis/transifex/docker.sh → .ci/transifex/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ cmake --version
gcc -v
tx --version

cd /citra
mkdir build && cd build
cmake .. -DENABLE_QT_TRANSLATION=ON -DGENERATE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SDL2=OFF
make translation
Expand Down
10 changes: 10 additions & 0 deletions .ci/windows-msvc/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -ex

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DCITRA_USE_BUNDLED_QT=1 -DCITRA_USE_BUNDLED_SDL2=1 -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_MF=ON -DENABLE_FFMPEG_VIDEO_DUMPER=ON

ninja
# show the caching efficiency
buildcache -s

ctest -VV -C Release || echo "::error ::Test error occurred on Windows MSVC build"
10 changes: 10 additions & 0 deletions .ci/windows-msvc/deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -ex

BUILDCACHE_VERSION="0.22.3"

choco install wget ninja
# Install buildcache
wget "https://github.com/mbitsnbites/buildcache/releases/download/v${BUILDCACHE_VERSION}/buildcache-win-mingw.zip"
7z x 'buildcache-win-mingw.zip'
mv ./buildcache/bin/buildcache.exe "/c/ProgramData/chocolatey/bin"
rm -rf ./buildcache/
Loading

0 comments on commit 0133ebe

Please sign in to comment.