From 575dde281d2adbeab199dbadfeab049f52aec07a Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Thu, 10 Dec 2020 22:10:04 +0100 Subject: [PATCH] Switch to GitHub actions --- .github/workflows/main.yml | 99 +++++++++++++++++++++++++ .travis.yml | 80 -------------------- {travis => ci}/build-static-binutils.sh | 0 {travis => ci}/build-static-patchelf.sh | 0 {travis => ci}/build.sh | 4 +- {travis => ci}/entrypoint.sh | 0 {travis => ci}/test-coverage.sh | 0 7 files changed, 101 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml rename {travis => ci}/build-static-binutils.sh (100%) rename {travis => ci}/build-static-patchelf.sh (100%) rename {travis => ci}/build.sh (95%) rename {travis => ci}/entrypoint.sh (100%) rename {travis => ci}/test-coverage.sh (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..15ffff4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,99 @@ +name: CI + +on: [push, pull_request] + +jobs: + appimage-x86_64: + name: Ubuntu latest x86_64 AppImage build + runs-on: ubuntu-latest + env: + ARCH: x86_64 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libmagic-dev libjpeg-dev libpng-dev cimg-dev + - name: Build AppImage + run: bash -ex ci/build.sh + - name: Archive artifacts + uses: actions/upload-artifact@v2 + with: + name: AppImage x86_64 + path: linuxdeploy*.AppImage* + + appimage-i386: + name: Ubuntu latest i386 AppImage build + runs-on: ubuntu-latest + env: + ARCH: x86_64 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libmagic-dev libjpeg-dev libpng-dev cimg-dev + - name: Build AppImage + run: bash -ex ci/build.sh + - name: Archive artifacts + uses: actions/upload-artifact@v2 + with: + name: AppImage i386 + path: linuxdeploy*.AppImage* + + coverage-x86_64: + name: Ubuntu latest x86_64 coverage build (no binaries uploaded) + runs-on: ubuntu-latest + env: + ARCH: x86_64 + BUILD_TYPE: coverage + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libmagic-dev libjpeg-dev libpng-dev cimg-dev + - name: Build AppImage + run: bash -ex ci/build.sh + + coverage-i386: + name: Ubuntu latest x86_64 coverage build (no binaries uploaded) + runs-on: ubuntu-latest + env: + ARCH: x86_64 + BUILD_TYPE: coverage + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libmagic-dev libjpeg-dev libpng-dev cimg-dev + - name: Build AppImage + run: bash -ex ci/build.sh + + upload: + name: Create release and upload artifacts + needs: + - appimage-x86_64 + - appimage-i386 + runs-on: ubuntu-latest + steps: + - name: Download artifacts + uses: actions/download-artifact@v2 + - name: Inspect directory after downloading artifacts + run: ls -alFR + - name: Create release and upload artifacts + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage + chmod +x pyuploadtool-x86_64.AppImage + ./pyuploadtool-x86_64.AppImage **/linuxdeploy*.AppImage* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7c79ff7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,80 +0,0 @@ -language: cpp - -matrix: - include: - - name: Ubuntu bionic x86_64 release build - env: ARCH=x86_64 - dist: bionic - addons: - apt: - update: true - packages: - - libmagic-dev - - libjpeg-dev - - libpng-dev - - cimg-dev - script: travis/build.sh - after_success: - - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh linuxdeploy-"$ARCH".AppImage* - - - name: Ubuntu bionic i386 build - env: ARCH=i386 - dist: bionic - addons: - apt: - update: true - packages: - - libmagic-dev:i386 - - libjpeg-dev:i386 - - libpng-dev:i386 - - gcc-multilib - - g++-multilib - - libfuse2:i386 - - libcairo2:i386 - script: travis/build.sh - after_success: - - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh linuxdeploy-"$ARCH".AppImage* - - - name: Ubuntu xenial x86_64 coverage build (no binaries uploaded) - env: ARCH=x86_64 BUILD_TYPE=coverage - dist: xenial - addons: - apt: - update: true - packages: - - libmagic-dev - - libjpeg-dev - - libpng-dev - - cimg-dev - before_script: - - sudo pip install gcovr - script: travis/test-coverage.sh - after_success: true # also, we don't intend to upload release binaries - - - name: Ubuntu xenial i386 coverage build (no binaries uploaded) - env: ARCH=i386 BUILD_TYPE=coverage - dist: xenial - addons: - apt: - update: true - packages: - - libmagic-dev:i386 - - libjpeg-dev:i386 - - libpng-dev:i386 - - gcc-multilib - - g++-multilib - - libfuse2:i386 - - libcairo2:i386 - before_script: - - sudo pip install gcovr - script: travis/test-coverage.sh - after_success: true # also, we don't intend to upload release binaries - -branches: - except: - - # Do not build tags that we create when we upload to GitHub Releases - - /^(?i:continuous)$/ diff --git a/travis/build-static-binutils.sh b/ci/build-static-binutils.sh similarity index 100% rename from travis/build-static-binutils.sh rename to ci/build-static-binutils.sh diff --git a/travis/build-static-patchelf.sh b/ci/build-static-patchelf.sh similarity index 100% rename from travis/build-static-patchelf.sh rename to ci/build-static-patchelf.sh diff --git a/travis/build.sh b/ci/build.sh similarity index 95% rename from travis/build.sh rename to ci/build.sh index e5c2ae6..aa27332 100755 --- a/travis/build.sh +++ b/ci/build.sh @@ -50,11 +50,11 @@ make -j"$(nproc)" linuxdeploy ctest -V # build patchelf -"$REPO_ROOT"/travis/build-static-patchelf.sh "$(readlink -f out/)" +"$REPO_ROOT"/ci/build-static-patchelf.sh "$(readlink -f out/)" patchelf_path="$(readlink -f out/usr/bin/patchelf)" # build custom strip -"$REPO_ROOT"/travis/build-static-binutils.sh "$(readlink -f out/)" +"$REPO_ROOT"/ci/build-static-binutils.sh "$(readlink -f out/)" strip_path="$(readlink -f out/usr/bin/strip)" # use tools we just built for linuxdeploy run diff --git a/travis/entrypoint.sh b/ci/entrypoint.sh similarity index 100% rename from travis/entrypoint.sh rename to ci/entrypoint.sh diff --git a/travis/test-coverage.sh b/ci/test-coverage.sh similarity index 100% rename from travis/test-coverage.sh rename to ci/test-coverage.sh