Skip to content

Commit

Permalink
workflows: Ignore build caches for the moment
Browse files Browse the repository at this point in the history
Fix `sudo` and package references in build and test flows.
  • Loading branch information
hjpotter92 committed Feb 23, 2023
1 parent 4a8b7d7 commit 854db02
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 57 deletions.
79 changes: 37 additions & 42 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
apt update
apt install -yqq build-essential make software-properties-common
add-apt-repository -y ppa:git-core/ppa
apt update && apt install -yqq git zip unzip
apt update && apt install -yqq git zip unzip zlib1g-dev zlib1g
- name: Check out code
uses: actions/checkout@v3.3.0
Expand Down Expand Up @@ -102,12 +102,12 @@ jobs:
run: ./install_ffmpeg.sh

- name: Build binaries
env:
GHA_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
run: |
git config --global --add safe.directory '*'
export PKG_CONFIG_PATH=/github/home/compiled/lib/pkgconfig
./ci_env.sh make
env:
GHA_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
- name: Upload build
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
Expand Down Expand Up @@ -158,6 +158,12 @@ jobs:
cache: true
cache-dependency-path: go.sum

- name: Set build environment
run: |
echo "GOARCH=${{ matrix.arch }}" >> $GITHUB_ENV
echo "GOOS=${{ matrix.platform.name }}" >> $GITHUB_ENV
echo "GO_BUILD_DIR=lp-builds/" >> $GITHUB_ENV
- name: Cache ffmpeg
id: cache-ffmpeg
uses: actions/cache@v3
Expand All @@ -173,29 +179,24 @@ jobs:
path: ~/build
key: ${{ runner.os }}-${{ matrix.platform.name }}-${{ matrix.arch }}-binaries-${{ github.sha }}

- name: Set build environment
run: |
echo "GOARCH=${{ matrix.arch }}" >> $GITHUB_ENV
echo "GOOS=${{ matrix.platform.name }}" >> $GITHUB_ENV
echo "GO_BUILD_DIR=lp-builds/" >> $GITHUB_ENV
- name: Install dependencies
run: brew install coreutils
run: brew install coreutils pkg-config

- name: Install go modules
if: steps.go.outputs.cache-hit != 'true'
# if: steps.go.outputs.cache-hit != 'true'
run: go mod download

- name: Install ffmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
# if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: ./install_ffmpeg.sh

- name: Build binaries
env:
GHA_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
run: |
git config --global --add safe.directory '*'
export PKG_CONFIG_PATH=~/compiled/lib/pkgconfig
./ci_env.sh make
env:
GHA_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
- uses: actions-ecosystem/action-regex-match@v2
id: match-tag
Expand Down Expand Up @@ -244,7 +245,7 @@ jobs:
apt update
apt install -yqq build-essential make software-properties-common
add-apt-repository -y ppa:git-core/ppa
apt update && apt install -yqq git zip unzip
apt update && apt install -yqq git zip unzip zlib1g-dev zlib1g coreutils binutils libc++-dev libc++abi-dev libtool p7zip-full mediainfo xz-utils
- name: Check out code
uses: actions/checkout@v3.3.0
Expand All @@ -265,58 +266,52 @@ jobs:

- name: Cache ffmpeg
id: cache-ffmpeg
uses: actions/cache@v2.1.5
uses: actions/cache@v3
with:
path: ~/compiled
key: ${{ runner.os }}-ffmpeg-tensorflow-${{ hashFiles('**/install_ffmpeg.sh') }}
path: /github/home/compiled
key: ${{ runner.os }}-ffmpeg-tf-${{ hashFiles('**/install_ffmpeg.sh') }}
restore-keys: |
${{ runner.os }}-ffmpeg-tensorflow
${{ runner.os }}-ffmpeg-tf-
- name: Cache binaries
uses: actions/cache@v2.1.5
uses: actions/cache@v3
with:
path: ~/build
key: ${{ runner.os }}-binaries-tensorflow-${{ github.sha }}
key: ${{ runner.os }}-binaries-tf-${{ github.sha }}

- name: Install dependencies
run: |
sudo apt-get update \
&& sudo apt-get install -y software-properties-common curl apt-transport-https \
&& sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 15CF4D18AF4F7421 \
&& sudo add-apt-repository "deb [arch=amd64] http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" \
&& sudo apt-get update \
&& sudo apt-get -y install clang-8 clang-tools-8 build-essential pkg-config autoconf gnutls-dev git python
apt-get update \
&& apt-get install -y software-properties-common curl apt-transport-https \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv 15CF4D18AF4F7421 \
&& add-apt-repository "deb [arch=amd64] http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" \
&& apt-get update \
&& apt-get -y install clang-8 clang-tools-8 build-essential pkg-config autoconf gnutls-dev git python
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 30 \
&& sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 30
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 30 \
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 30
LIBTENSORFLOW_VERSION=2.3.4 \
&& curl -LO https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-${LIBTENSORFLOW_VERSION}.tar.gz \
&& sudo tar -C /usr/local -xzf libtensorflow-gpu-linux-x86_64-${LIBTENSORFLOW_VERSION}.tar.gz \
&& sudo ldconfig
&& tar -C /usr/local -xzf libtensorflow-gpu-linux-x86_64-${LIBTENSORFLOW_VERSION}.tar.gz \
&& ldconfig
- name: Install go modules
if: steps.go.outputs.cache-hit != 'true'
# if: steps.go.outputs.cache-hit != 'true'
run: go mod download

- name: Install ffmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: ./install_ffmpeg.sh

- name: Build binaries
run: |
export PKG_CONFIG_PATH=~/compiled/lib/pkgconfig
./ci_env.sh make
rm -rf ~/build && mkdir ~/build && mv livepeer* ~/build/
env:
GHA_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}

- name: Install libtensorflow
run: |
LIBTENSORFLOW_VERSION=2.3.4 \
&& curl -LO https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-${LIBTENSORFLOW_VERSION}.tar.gz \
&& sudo tar -C /usr/local -xzf libtensorflow-gpu-linux-x86_64-${LIBTENSORFLOW_VERSION}.tar.gz \
&& sudo ldconfig
git config --global --add safe.directory '*'
export PKG_CONFIG_PATH=/github/home/compiled/lib/pkgconfig
./ci_env.sh make cgo_cflags="-lz" all
rm -rf ~/build && mkdir ~/build && mv livepeer* ~/build/
- name: Upload build
run: cp ~/build/* . && ./upload_build.sh
Expand Down
42 changes: 27 additions & 15 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ jobs:
test:
name: Run tests defined for the project
runs-on: ubuntu-latest
container:
image: ubuntu:18.04
steps:
- name: Setup ubuntu container
run: |
apt update
apt install -yqq build-essential make software-properties-common
add-apt-repository -y ppa:git-core/ppa
apt update && apt install -yqq git zip unzip zlib1g-dev zlib1g
- name: Check out code
uses: actions/checkout@v3.3.0
with:
Expand All @@ -38,40 +47,41 @@ jobs:
id: cache-ffmpeg
uses: actions/cache@v3
with:
path: ~/compiled
path: /github/home/compiled
key: ${{ runner.os }}-ffmpeg-${{ hashFiles('**/install_ffmpeg.sh') }}
restore-keys: |
${{ runner.os }}-ffmpeg
- name: Install dependencies
run: |
sudo apt-get update \
&& sudo apt-get install -yqq software-properties-common curl apt-transport-https \
&& sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 15CF4D18AF4F7421 \
&& sudo add-apt-repository "deb [arch=amd64] http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" \
&& sudo apt-get update \
&& sudo apt-get -yqq install clang-8 clang-tools-8 build-essential pkg-config autoconf git python
apt-get update \
&& apt-get install -yqq software-properties-common curl apt-transport-https \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv 15CF4D18AF4F7421 \
&& add-apt-repository "deb [arch=amd64] http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" \
&& apt-get update \
&& apt-get -yqq install clang-8 clang-tools-8 build-essential pkg-config autoconf git python
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 30 \
&& sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 30
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 30 \
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 30
- name: Install go modules
if: steps.go.outputs.cache-hit != 'true'
# if: steps.go.outputs.cache-hit != 'true'
run: go mod download

- name: Install ffmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
# if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: ./install_ffmpeg.sh

- name: Install protobuf
run: |
go install github.com/golang/protobuf/protoc-gen-go@v1.3.5
sudo apt-get update
sudo apt-get install -yqq protobuf-compiler
apt-get update
apt-get install -yqq protobuf-compiler
- name: go fmt
run: |
echo "PKG_CONFIG_PATH=${HOME}/compiled/lib/pkgconfig" >> $GITHUB_ENV
git config --global --add safe.directory '*'
echo "PKG_CONFIG_PATH=/github/home/compiled/lib/pkgconfig" >> $GITHUB_ENV
go fmt ./...
git diff --exit-code
Expand All @@ -90,8 +100,10 @@ jobs:
uses: reviewdog/action-misspell@v1

- name: Run tests with coverage
env:
CGO_CFLAGS: "-lz"
run: |
export PKG_CONFIG_PATH=~/compiled/lib/pkgconfig
export PKG_CONFIG_PATH=/github/home/compiled/lib/pkgconfig
./test.sh
./test_e2e.sh
Expand Down

0 comments on commit 854db02

Please sign in to comment.