Commit Graph

108 Commits

Author SHA1 Message Date
Joey Parrish a472194c77 ci: Compute sha1 from ref in advance in lab and screenshot workflows (#6811)
Always compute sha1 in lab and screenshot workflows in advance.  A symbolic ref can change mid-workflow if the repo changes.

Co-authored-by: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com>
2024-06-13 12:48:37 -07:00
Joey Parrish 8f89bef0a9 ci: Move set-commit-status custom action to shaka-github-tools repo (#6808) 2024-06-12 13:03:08 -07:00
Joey Parrish 790cc35116 ci: Add overall test timeout of 30 minutes (#6583)
When tests occasionally timeout (as is currently happening with
IndexedDB hangs on Mac), we should stop the test run after 30 minutes
and allow the "deflake" workflow to rerun them. Without this timeout,
the test run can takes hours.

A successful test run takes 15-20 minutes currently.
2024-05-11 10:37:54 -07:00
Joey Parrish 7df5975cfe ci: Fix workflow request for disabled browsers (#6570)
You should be able to request a browser explicitly even if it is disabled by default.  This fixed the workflow logic that limited this.
2024-05-09 11:14:17 -07:00
Joey Parrish 975235beb1 ci: Add additional lab Chromecast devices (#6563)
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-05-09 12:01:22 +02:00
Joey Parrish 2a4476a141 ci: Fix macOS CI failures (#6523)
- Install Edge & Firefox explicitly
 - Switch to macos-13 for now to resolve Edge & Chrome timeouts

Issue #6508
2024-05-01 15:26:04 -07:00
Joey Parrish 156893f51d ci: Fix main tags (#6509)
The condition for tagging the main branch was inverted after v4.7.11.

The main-branch tags for v4.6.16, v4.6.17, v4.7.12, v4.7.13, and v4.8.1
all had to be created and pushed by hand to correct this.
2024-04-30 07:05:08 +02:00
Joey Parrish 3ce9e30f5e ci: Fix appspot promotion during deployment (#6503)
Since upgrading the deployment action from v0 to v2, and stumbling into
google-github-actions/deploy-appengine#361, new versions were not
properly promoted. However, our promotion setting in the workflow was
actually ignored the whole time due to a missing "echo".

Closes #6502
2024-04-29 12:02:01 -07:00
Joey Parrish 858ba9eabc ci: Update release-please-action and drop upload-release-action (#6319)
Upgrading release-please-action to v4 requires some changes:
 - Move some settings from the action inputs to a manifest file (release-type, extra-files)
 - Rename default-branch to target-branch

Additionally:
 - There is an example in the new release-please-action docs that covers our exact use case for upload-release-action, but with the official GitHub CLI app.  So we drop upload-release-action and use the GitHub CLI instead.
 - There is an output in release-please-action that gives access to the patch version from semver.  We should use this instead of running endsWith() over tag_name.
 - Update mxschmitt/action-tmate@v3.6 => v3.17.  This is a trivial update on an action that I missed in my last audit.
2024-03-04 21:30:41 -08:00
Joey Parrish 4a15d06c57 ci: Update more actions (#6307)
I missed some before.  I only updated actions from GitHub "actions/..."

This updates all other actions except google-github-actions/release-please, which has some breaking changes we would need to absorb and test.
2024-02-27 16:12:11 -08:00
Joey Parrish 7c00ac42a0 ci: Improve CI status setting (#6306)
- Link CI status to specific jobs, not just the run
 - Split selenium job status flag away from ignore_test_status (which is for getting screenshots)
 - Remove redundant status setting step in update-screenshots
 - Fix final status computation in update-screenshots to account for edge cases and old typo
2024-02-27 15:24:47 -08:00
Joey Parrish 543dafcfea ci: Update all actions (#6305)
This eliminates warnings about outdated node runtimes in GitHub Actions.

actions/download-artifact and actions/upload-artifact are the only ones
with any potential breaking changes, and adjustments have been made and
tested.

See
https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md
2024-02-27 13:35:27 -08:00
Joey Parrish 0692e234d1 ci: Tweak command parsing (#6269)
- Fix wrong index variable in loop ("i" vs "INDEX") that prevented
detection of commands at arbitrary places in a comment.
 - Fix parsing of comments with newlines.
 - Normalize commands to lowercase before checking them.
 - Enhance debugging of command parsing.
- Allow the user to say "please" because it just feels nicer to me, even
when I'm talking to a robot.
2024-02-21 15:29:54 -08:00
Joey Parrish 169b3e2583 ci: Simplify release version updates (#5724)
lib/player.js was being updated separately because:

1. Originally, we didn't have support for updating arbitrary files with
release-please.
2. When we did get that support in release-please, it would trash the
"-uncompiled" tag we have in uncompiled mode.

By separating the uncompiled version string into two parts and using the
extra-files feature of release-please, we can get the updater to
preserve the "-uncompiled" tag and simplify the release workflow to only
update the PR once per change instead of twice.
2023-10-04 13:47:49 -07:00
Joey Parrish 5a88f3709a ci: Expand deflaking to all lab test and PR test runs (#5625)
Before we only tried to deflake nightly lab test runs, not manual lab
test runs or PR tests. This expands the use to all lab and PR tests.
2023-09-08 13:30:15 -07:00
Joey Parrish e358bce00e ci: Add Chromecast GTV device to the lab (#5612) 2023-09-06 10:37:39 -07:00
Joey Parrish 93df8d1d29 ci: Publish NPM tags explicitly (#5608)
This avoids the implied "latest" tag being added to each and every
release by adding explicit, branch-derived tags to each release, then
setting "latest" explicitly based on the highest release number so far.

See
https://github.com/shaka-project/shaka-player/issues/5599#issuecomment-1707047101
2023-09-06 09:17:48 +02:00
Joey Parrish 1da4f4cd17 ci: Fix version update in release workflow (#5605)
In #5588 we switched off one part of using a fork for release PRs, but
not every part. That caused player.js not to be updated in release PRs,
which broke NPM releases.

This fixes the issue by removing other references to the shaka-bot fork.

Closes #5599
2023-09-05 10:13:51 -07:00
Joey Parrish 87147fa782 ci: Do not use a fork for release actions (#5588)
Stop using a fork to run release actions. Either it is missing a feature
or I misunderstood what that flag is for. See
https://github.com/google-github-actions/release-please-action/issues/819
2023-09-02 08:07:38 +02:00
Joey Parrish 1beb5bc09e ci: Use shaka-bot for coverage reports (#5580) 2023-09-01 19:25:51 -07:00
Joey Parrish 951c57278c ci: Use shaka-bot for releases (#5585)
This enables workflows to be triggered automatically on release PRs,
instead of requiring maintainers to edit the PR description on every
release to trigger required PR workflows.

This uses a separate token from the other shaka-bot token, because it
requires additional permissions to make releases.
2023-09-01 19:24:38 -07:00
Shaka Bot ffc47b90d1 chore: Sync common workflows (#5586)
This is an automated sync of common workflows for this organization.
The upstream source is:

https://github.com/shaka-project/shaka-github-tools/commit/4245160a0b8577baae0ffb75b6b365d850d52fde

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2023-09-01 19:24:00 -07:00
Joey Parrish 27e991d11e ci: Talk to Shaka Bot (#5565)
Now maintainers can send commands to Shaka Bot via PR comments.

Initially, Shaka Bot understands the following commands from anyone:
 - `@shaka-bot help`: Show this help message

And the following commands from maintainers only:
 - `@shaka-bot test`: Start lab tests on all devices
- `@shaka-bot test ce`: Start lab tests on CE devices only (no desktop
browsers)
2023-08-31 10:15:17 -07:00
Joey Parrish 7f7dda30a9 ci: Revert "main branch only - fix bad release PR" (#5564)
This reverts commit 18ffa2cbbc.

So long as we make feature releases with a reasonable (< 100 PRs)
granularity, we won't need to keep doing this. Let's try to keep v4.4 an
anomaly.
2023-08-30 16:31:28 -07:00
Joey Parrish 7c2bfaa978 ci: Fix incremental coverage reports (#5552) 2023-08-29 10:19:35 -07:00
Joey Parrish 8f867cdec9 ci: Fix Chrome tests on Windows in GitHub Actions (#5548)
GitHub started installing "Chrome for Testing" builds on Windows and
Mac. Unfortunately, these builds don't have support for H264 and AAC
codecs, which we need in our tests.

This fixes the issue by explicitly installing an official build of
Chrome on Windows, to overwrite the "Chrome for Testing" build.
2023-08-28 11:15:29 -07:00
Joey Parrish 92edb7b1ef test: Cache Babel output (#5539)
This caches Babel's transpiler output for reuse, and should speed up all
test runs in theory, but the effect is most noticeable on local test
runs.

This uses a fork of karma-babel-preprocessor, which contains
https://github.com/babel/karma-babel-preprocessor/pull/77. If/when that
PR is merged, we can move back to the upstream module.

Local runs will start faster because only modified source files will be
re-processed through Babel when the tests start up.

In the Selenium workflow, Babel output and node_modules will both be
computed by the singular build-shaka job, stored, and then reused by all
the Selenium lab matrix jobs.

On my workstation (3.3 GHz cores, 32GB RAM, spinning platter disk), I
see tests start about ~60 seconds faster. In the lab (2.1-4.7 GHz cores,
64GB RAM, solid-state disk), I see tests start about ~10 seconds faster.
2023-08-28 08:59:02 +02:00
Joey Parrish 081cd9645f ci: Update environment variable name for runner port (#5523)
As I was building packages for shaka-lab services in the shaka-project/shaka-lab repo, it occurred to me that this KARMA_PORT variable was too specific to the shaka-player project.  Instead, the new shaka-lab package for self-hosted runners will have a more generic ALLOCATED_PORT variable.  This updates the CI workflow to use that new name.
2023-08-22 11:20:15 -07:00
Álvaro Velad Galván a23524845a chore: Use Edge Windows for coverage report (#5517) 2023-08-21 13:32:02 -07:00
Joey Parrish a3d5dc54ff ci: Fix Chrome failures on Mac VMs (#5509) 2023-08-19 09:47:53 +02:00
Joey Parrish 6f2f8c2468 test: Drop --lets-encrypt-folder from test.py (#5455)
When we first deployed certificates from letsencrypt, we did not know
about the "live" folder, which contains helpful symlinks to the latest
certificate. Instead, we were copying the entire "archive" folder, which
contains even old certs, then searching that folder for the latest
version. We should be using the "live" folder instead, letting certbot
maintain the symlinks. This means there is no need for
--lets-encrypt-folder in test.py.
2023-08-07 09:11:43 -07:00
Joey Parrish ace3e37241 ci: Refactor and update Shaka lab definitions (#5449)
- In karma.conf.js, give ourselves the ability to merge Selenium configs together without clobbering argument lists, for better deduplication in shaka-lab.yaml.  This is based on https://github.com/shaka-project/karma-local-wd-launcher/pull/50
 - Refactor shaka-lab.yaml to take advantage of this new ability.  This removes a bunch of duplicate command line arguments for various versions of Chrome.
 - Remove a TODO about a bug that Chrome decided they would never fix.
 - Sort the list of devices and platforms, with comments to mark out the sections.
 - Remove IE11, which we are well past supporting or testing.

This should be cherry-picked to all active branches.
2023-07-31 11:02:23 -07:00
Shaka Bot d6d5b155ff chore: Sync common workflows (#5434)
This is an automated sync of common workflows for this organization.
The upstream source is:
https://github.com/shaka-project/shaka-github-tools/commit/208556c5ea86a1329f7d1f36fdcf6ed6abbb907b

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2023-07-24 17:18:11 -07:00
Joey Parrish 4df82540c2 ci: Add one-off workflow for appspot deployment (#5337)
This is a much simplified version of the appspot job from the release
workflow, but with control given to the human caller instead of computed
from release details. It can be used to correct deployment issues.
2023-06-20 19:40:13 -07:00
Joey Parrish c1369de55d ci: main branch only - fix bad release PR (#5334)
This fixes a bad release PR caused by too many commits between main
branach releases. This should not be cherry-picked to any other branch.
2023-06-20 13:12:39 -07:00
Joey Parrish 866ddb0c11 ci: Make version index aware of deployments (#5203)
Due to limits in the number of versions you can have deployed at once on
App Engine, we can no longer keep every version of the Shaka Player Demo
deployed. So the version index needs to be aware of which versions are
deployed, and only link to versions that are still available.

This makes the index generator aware of App Engine deployments.
2023-04-29 08:54:31 -07:00
Joey Parrish 4337dbfb4c ci: Add browser filter to lab workflow (#5064)
This allows us to run the lab tests on a subset of browsers/platforms
for a given PR.
2023-03-07 09:38:25 -08:00
Joey Parrish 25fc81e7a9 ci: Fix workflow to update screenshots (#4993)
The initial commit was untested, but having the workflow in the main
branch allowed me to iterate on the workflow and test it in a branch.

The following changes were made:
- Standardize how workflow inputs are read (using inputs, which works
for all triggers, instead of github.event.inputs, which only works for
some triggers)
 - Improve the description of test_filter in selenium-lab-tests.
- Add missing fields in the workflow_call trigger of
selenium-lab-tests.yaml. (Unfortunately, the two triggers need to have
the inputs defined separately, and with slightly different fields.)
 - Log the chosen ref in selenium-lab-tests, to help debug inputs.
- Fix variable expansion in selenium-lab-tests so that test_filter can
contain spaces.
- Fix ignore_test_status, which did not work at all and broken the
nightly tests last night.
 - Fix dependencies between jobs in update-screenshots.
- Do not set status for the subordinate selenium-lab-tests job if
started from update-screenshots.
- Always upload screenshots from selenium-lab-tests if started from
update-screenshots (normally only uploaded on failure).
 - Set the PR status from upload-screenshots.
 - Fix unpacking of screenshots from artifacts in upload-screenshots.
 - Fix updating of changed screenshots.
 - Fix handling of a lack of screenshot changes.
 - Split up the jobs for easier debugging in upload-screenshots.

Still to do:
 - Fix setting of final PR status
- Use a personal access token so that tests can be triggered from the PR
push
2023-02-23 11:26:40 -08:00
Joey Parrish a8c2491047 ci: Experimental workflow to update screenshots in a PR (#4991)
Untested. A workflow must exist in the main branch before a version of
it from any branch can be triggered.
2023-02-09 15:08:37 -08:00
Joey Parrish ee77d35244 ci: Update the version index nightly (#4990)
The release trigger does not work yet, so compensate with a nightly
schedule.

Closes #4361
2023-02-09 11:45:13 -08:00
Joey Parrish f45631834d fix(WebVTT): Fix horizontal positioning with cue box size (#4949)
When the VTT size setting is used, the horizontal positioning was wrong
in both native and UI display.

The native display is wrong on Chrome and Edge because of a layout bug
in Chrome, where the shadow DOM for the cue box has conflicting
(redundant) styles. For example, these VTT settings:

`line: 85% position: 50% size: 63%`

result in these styles in the shadow DOM:

`top: 85%; left: 18.5%; transform: translate(-18.5%, -85%)`.

The `translate` style is what breaks the positioning. Unfortunately,
there is no way to fix that in JavaScript.

The UI display, however, was buggy for different reasons and is fixable.
The styles `left: 0; top: 0;` were applied by default, and then `top:
85%;` and `width: 63%;` were set based on the cue settings. The default
of `left: 0` was what broke the positioning. Removing this leaves `left`
set implicitly to `auto`, which is correct.

No other test cases were broken (or fixed) by this change.

This also adds a filter parameter to the lab workflow to run a subset of
tests for quicker results. This is useful for updating screenshots.

Closes b/259121343
2023-01-30 16:01:25 -08:00
Joey Parrish eeb647cec5 ci: Upload screenshots on test failures (#4917)
This will upload screenshots when the Selenium lab tests fail. This can
be used to get screenshot changes either for examination or for updating
the test expectations.
2023-01-19 13:49:01 -08:00
Joey Parrish da0b818321 ci: Force update to Edge 108 (#4826)
Since Edge 107 on Linux has an outdated CDM causing test failures, we
have to force update to Edge 108 in GitHub Actions.

Closes #4825
2022-12-13 06:56:49 +01:00
Joey Parrish 28b73b921d fix(hls): Fix type error in lazy-loading (#4687)
There was a potential type error in an edge case in lib/player.js. It
would have been caught by the latest compiler, so this upgrades the
compiler and fixes another type error in one other place, as well.
2022-11-11 07:07:58 -08:00
Joey Parrish 7772099029 build: Fix Docker-based builds (#4633)
This removes the overly-complex docker-compose system and rewrites the
Dockerfile. It also changes the docker commands to those that specify a
user ID, so that build outputs are written as the current user.

Closes #4387 (failed docker build not detected in CI)
Issue #4619 (failed to build w/ docker)
2022-10-28 15:43:16 -07:00
Shaka Bot ebc81d0f3a chore: Sync common workflows (#4628)
This is an automated sync of common workflows for this organization.
The upstream source is:

https://github.com/shaka-project/shaka-github-tools/commit/8bfe75f0d28b0b824e37b192623abb528bd275b0

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2022-10-27 11:53:09 -07:00
Joey Parrish 0601e5d9c0 ci: Update actions/checkout version (#4603)
v2 uses a deprecated node version (12), and v3 uses a current version
(16).
2022-10-26 07:17:44 +02:00
Joey Parrish 3c2d3c8ffc ci: Fix incremental coverage reports (#4602)
Broken in 062aa07e71 (#4588)
2022-10-19 16:02:41 -07:00
Joey Parrish 0209ba701c ci: Re-run PR tests when leaving draft mode (#4594)
Because our release PRs are created with the default GitHub token, they
do not trigger test runs. This is a feature of GitHub that prevents
recursive loops of workflows.

This change makes it so that marking a PR "ready for review" will
trigger the tests to run again. This gives us an easy way to trigger
test runs on a release PR, by marking it a draft, then marking it
"ready" again.
2022-10-18 16:53:49 -07:00
Joey Parrish 062aa07e71 ci: Update workflow syntax (#4588)
GitHub is deprecating the set-output syntax and moving to writing
outputs to a file. This updates our workflows to match.

See
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2022-10-17 19:27:42 -07:00