From 9fc3ee118641593d3271046488ffdaa81af45917 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Wed, 13 Oct 2021 12:11:35 -0700 Subject: [PATCH] test: Run docker-based Linux distro tests in GitHub Actions When testing a PR or release, make sure the build still passes on all supported Linux distros. Change-Id: Id7046e8eb8fe999965ea22e12dd1ffdce2fa2d63 --- .github/workflows/build_and_test.yaml | 30 +++++++++++++++++++++++++++ .github/workflows/github_release.yaml | 30 +++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 4e891722f7..589d569113 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -100,3 +100,33 @@ jobs: build_type: ${{ matrix.build_type }} build_type_suffix: ${{ matrix.build_type_suffix }} exe_ext: ${{ matrix.exe_ext }} + + test_supported_linux_distros: + # Doesn't really "need" it, but let's not waste time on a series of docker + # builds just to cancel it because of a linter error. + needs: lint + name: Test builds on all supported Linux distros (using docker) + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + path: src + ref: ${{ github.event.inputs.ref || github.ref }} + + - name: Install depot tools + shell: bash + run: | + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + echo "${GITHUB_WORKSPACE}/depot_tools" >> $GITHUB_PATH + + - name: Setup gclient + shell: bash + run: | + gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged + # NOTE: the docker tests will do gclient runhooks, so skip hooks here. + gclient sync --nohooks + + - name: Test all distros + shell: bash + run: ./src/packager/testing/dockers/test_dockers.sh diff --git a/.github/workflows/github_release.yaml b/.github/workflows/github_release.yaml index 548b3e7745..976ac13a78 100644 --- a/.github/workflows/github_release.yaml +++ b/.github/workflows/github_release.yaml @@ -184,6 +184,36 @@ jobs: release_id: ${{ needs.draft_release.outputs.release_id }} assets_path: artifacts + test_supported_linux_distros: + # Doesn't really "need" it, but let's not waste time on a series of docker + # builds just to cancel it because of a linter error. + needs: lint + name: Test builds on all supported Linux distros (using docker) + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + path: src + ref: ${{ github.event.inputs.ref || github.ref }} + + - name: Install depot tools + shell: bash + run: | + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + echo "${GITHUB_WORKSPACE}/depot_tools" >> $GITHUB_PATH + + - name: Setup gclient + shell: bash + run: | + gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged + # NOTE: the docker tests will do gclient runhooks, so skip hooks here. + gclient sync --nohooks + + - name: Test all distros + shell: bash + run: ./src/packager/testing/dockers/test_dockers.sh + publish_release: name: Publish GitHub release needs: [draft_release, build_and_test]