Skip to content

Commit

Permalink
test: Run docker-based Linux distro tests in GitHub Actions
Browse files Browse the repository at this point in the history
When testing a PR or release, make sure the build still passes on all
supported Linux distros.

Change-Id: Id7046e8eb8fe999965ea22e12dd1ffdce2fa2d63
  • Loading branch information
joeyparrish committed Oct 14, 2021
1 parent 1b96427 commit 9fc3ee1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 30 additions & 0 deletions .github/workflows/github_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9fc3ee1

Please sign in to comment.