From 5fdaef03a3cc2b810f2b621929da9cc83447ab68 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 21 May 2021 12:06:16 +0200 Subject: [PATCH] GitHub CI [Linux ARM]: use code checked out by GitHub Use code checked out by GitHub Action - previously there was a clone but we want rather the actual code, which doesn't need to be in master branch of the main repository. This also requires a small refactor (chroot in home rather than in $GITHUB_WORKSPACE) --- .github/scripts/Linux/arm/build.sh | 10 ---------- .github/workflows/arm-build.yml | 26 ++++++++++++++------------ src/video_compress/libavcodec.cpp | 1 - 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/scripts/Linux/arm/build.sh b/.github/scripts/Linux/arm/build.sh index 64db4c0b8..f2f09aef0 100755 --- a/.github/scripts/Linux/arm/build.sh +++ b/.github/scripts/Linux/arm/build.sh @@ -7,21 +7,11 @@ export LD_LIBRARY_PATH=$EXTRA_LIB_PATH${LD_LIBRARY_PATH:+":$LD_LIBRARY_PATH"} export PATH=/usr/local/bin:$PATH export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH:+":$PKG_CONFIG_PATH"} -PWD=`pwd` APPDIR=UltraGrid.AppDir ARCH=`dpkg --print-architecture` APPNAME=UltraGrid-latest-${ARCH}.AppImage DIR=UltraGrid-AppImage -cleanup() { - rm -rf $PWD/UltraGrid -} -trap cleanup EXIT - -git clone --depth 1 https://github.com/CESNET/UltraGrid.git - -cd UltraGrid - ./autogen.sh --enable-plugins mkdir $APPDIR diff --git a/.github/workflows/arm-build.yml b/.github/workflows/arm-build.yml index 1fc10dc23..cc418c8d8 100644 --- a/.github/workflows/arm-build.yml +++ b/.github/workflows/arm-build.yml @@ -29,36 +29,38 @@ jobs: id: cache-bootstrap uses: actions/cache@v2 with: - path: 'chroot.tar' + path: '~/chroot.tar' key: cache-bootstrap-${{ matrix.arch }}-6 - name: Debootstrap if: steps.cache-bootstrap.outputs.cache-hit != 'true' run: | sudo apt install debootstrap debian-archive-keyring - sudo mkdir chroot + sudo mkdir ~/chroot wget http://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -q - sudo qemu-debootstrap --keyring=${{ matrix.keyring }} --arch ${{ matrix.arch }} buster chroot ${{ matrix.repo }} - sudo cp $GITHUB_WORKSPACE/.github/scripts/Linux/arm/{bootstrap.sh,mksquashfs-compilation-fix.patch} chroot - sudo chroot chroot /bootstrap.sh ${{ matrix.arch }} - sudo tar cf chroot.tar chroot # Create archive for caching. Needs to be created as root, therefore created manually. + sudo qemu-debootstrap --keyring=${{ matrix.keyring }} --arch ${{ matrix.arch }} buster ~/chroot ${{ matrix.repo }} + sudo cp $GITHUB_WORKSPACE/.github/scripts/Linux/arm/{bootstrap.sh,mksquashfs-compilation-fix.patch} ~/chroot + sudo chroot ~/chroot /bootstrap.sh ${{ matrix.arch }} + cd ~ && sudo tar cf chroot.tar chroot # Create archive for caching. Needs to be created as root, therefore created manually. - name: Extract Cached Environment if: steps.cache-bootstrap.outputs.cache-hit == 'true' - run: sudo tar xf chroot.tar + run: | + cd ~ + sudo tar xf chroot.tar - name: Build run: | - sudo cp .github/scripts/Linux/arm/build.sh chroot - sudo chroot chroot /build.sh + sudo cp -ar $GITHUB_WORKSPACE ~/chroot/UltraGrid + sudo chroot ~/chroot /bin/sh -ec "cd UltraGrid; .github/scripts/Linux/arm/build.sh" - name: Upload Build if: github.repository != 'CESNET/UltraGrid' || github.ref != 'refs/heads/arm-build' - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: UltraGrid CI ${{ matrix.arch }} build - path: chroot/UltraGrid/UltraGrid-latest-${{ matrix.arch }}.AppImage + path: '~/chroot/UltraGrid/UltraGrid-latest-${{ matrix.arch }}.AppImage' - name: Upload Release Asset if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/arm-build' run: | sudo apt install jq - sudo .github/scripts/replace-asset.sh GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} continuous chroot/UltraGrid/UltraGrid-latest-${{ matrix.arch }}.AppImage application/x-appimage Linux%20${{ matrix.arch }}%20build + sudo .github/scripts/replace-asset.sh GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} continuous ~/chroot/UltraGrid/UltraGrid-latest-${{ matrix.arch }}.AppImage application/x-appimage Linux%20${{ matrix.arch }}%20build # vi: set expandtab sw=2: diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 00f0303d4..8496f676a 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -74,7 +74,6 @@ extern "C" { #include #include -#include } #include "hwaccel_libav_common.h" #endif