From adf1eb084055e68bd7f62a47273fed5291eda9f2 Mon Sep 17 00:00:00 2001 From: Adrien RICCIARDI Date: Sun, 23 Jan 2022 11:24:23 +0100 Subject: [PATCH] Added GitHub Action CI. (#518) * Added GitHub Action CI. Signed-off-by: RICCIARDI-Adrien * Removed Travis CI support. Signed-off-by: RICCIARDI-Adrien --- .github/workflows/build.yaml | 32 ++++++++++++++++++++++++++++++ .travis.yml | 38 ------------------------------------ tests/tests-ci.sh | 31 ++++++++++++++--------------- 3 files changed, 47 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/build.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..d7d812da --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,32 @@ +name: Build +on: [push, pull_request] + +jobs: + build: + name: Build + runs-on: ubuntu-20.04 + container: ubuntu:xenial + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TRAVIS_BUILD_NUMBER: ${{ github.run_number }} + VERSION: ${{ github.ref_name }} + steps: + - name: Configure build machine + run: | + apt update + apt install -y -q apt-transport-https curl git kmod software-properties-common sudo wget + # The keyboard-configuration package is needed later and requires the user to input a number via dpkg-reconfigure, so preinstall it without front-end to avoid blocking the later installations + DEBIAN_FRONTEND=noninteractive apt install -y -q keyboard-configuration + - name: Checkout sources + run: | + # Can't use actions/checkout@v2 action here because Ubuntu 16.04 git version is too old, so the action downloads an archive instead of a git repository, and this prevents linuxdeployqt from finding the commit it is built from + git clone --depth=1 https://github.com/${{ github.repository }} --branch=${{ github.ref_name }} . + - name: Environment tests + run: ./tests/tests-environment.sh + - name: CI tests + run: ./tests/tests-ci.sh + - name: Deploy release (only when building from master branch) + if: ${{ github.ref == 'refs/heads/master' }} + run: | + wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + bash ./upload.sh ./linuxdeployqt-*.AppImage* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0ec7e307..00000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -language: cpp -dist: xenial -virt: vm -group: edge -arch: - # The following seems not to work; still runs on an amd64 host; - # maybe because we have not been migrated from travis-ci.org to travis-ci.com yet? - # arm64-graviton2 - - amd64 - -os: linux - -env: - global: - - DISPLAY=:99 - -before_install: - - ./tests/tests-environment.sh - -before_script: - - git fetch --unshallow - -script: - - ./tests/tests-ci.sh - -after_success: - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - # quick fix for issue 223 - - if [ "$TRAVIS_TAG" != "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - - bash ./upload.sh ./linuxdeployqt-*.AppImage* pvs-studio-report.* - -after_script: - - "xpra stop :99" - -branches: - except: - - # Do not build tags that we create when we upload to GitHub Releases - - /^(?i:continuous)$/ diff --git a/tests/tests-ci.sh b/tests/tests-ci.sh index d3d7b643..e054d0d8 100755 --- a/tests/tests-ci.sh +++ b/tests/tests-ci.sh @@ -4,18 +4,18 @@ set -x source /opt/qt*/bin/qt*-env.sh /opt/qt*/bin/qmake CONFIG+=release CONFIG+=force_debug_info linuxdeployqt.pro -# make -j$(nproc) # Not doing here but below with "pvs-tool trace" +make -j$(nproc) -# Test -wget -q -O - http://files.viva64.com/etc/pubkey.txt | sudo apt-key add - -sudo wget -O /etc/apt/sources.list.d/viva64.list http://files.viva64.com/etc/viva64.list -sudo apt-get update -sudo apt-get -y install --no-install-recommends pvs-studio -pvs-studio-analyzer credentials probono@puredarwin.org $PVS_KEY -o ./licence.lic -pvs-studio-analyzer trace -- make -j$(nproc) -pvs-studio-analyzer analyze -e /opt -e /usr -o pvs-studio.log -j $(nproc) -l ./licence.lic -plog-converter -a GA:1,2 -t tasklist -o pvs-studio-report.txt pvs-studio.log -rm ./licence.lic +# Test (it is commented out because current PVS Studio license is expired, it might be re-enabled later if a new license is granted) +#wget -q -O - http://files.viva64.com/etc/pubkey.txt | sudo apt-key add - +#sudo wget -O /etc/apt/sources.list.d/viva64.list http://files.viva64.com/etc/viva64.list +#sudo apt-get update +#sudo apt-get -y install --no-install-recommends pvs-studio +#pvs-studio-analyzer credentials probono@puredarwin.org $PVS_KEY -o ./licence.lic +#pvs-studio-analyzer trace -- make -j$(nproc) +#pvs-studio-analyzer analyze -e /opt -e /usr -o pvs-studio.log -j $(nproc) -l ./licence.lic +#plog-converter -a GA:1,2 -t tasklist -o pvs-studio-report.txt pvs-studio.log +#rm ./licence.lic # exit on failure set -e @@ -26,8 +26,7 @@ cp ./bin/linuxdeployqt linuxdeployqt.AppDir/usr/bin/ cp -r /usr/local/lib/appimagekit linuxdeployqt.AppDir/usr/lib/ chmod +x linuxdeployqt.AppDir/AppRun find linuxdeployqt.AppDir/ -export VERSION=continuous -if [ ! -z $TRAVIS_TAG ] ; then export VERSION=$TRAVIS_TAG ; fi +if [ -z "$VERSION" ] ; then export VERSION=continuous ; fi ./bin/linuxdeployqt linuxdeployqt.AppDir/linuxdeployqt.desktop -verbose=3 -appimage \ -executable=linuxdeployqt.AppDir/usr/bin/desktop-file-validate ls -lh @@ -43,7 +42,7 @@ do done # enable core dumps -echo "/tmp/coredump" | sudo tee /proc/sys/kernel/core_pattern +#echo "/tmp/coredump" | sudo tee /proc/sys/kernel/core_pattern ulimit -c unlimited ulimit -a -S @@ -52,8 +51,8 @@ ulimit -a -H # error handling performed separately set +e -# print version number -./linuxdeployqt-*-x86_64.AppImage --version +# print version number (need to extract the AppImage because we are running in a container, see https://github.com/AppImage/AppImageKit/wiki/FUSE#docker) +./linuxdeployqt-*-x86_64.AppImage --appimage-extract-and-run --version # TODO: reactivate tests #bash -e tests/tests.sh