Commit Graph

151 Commits

Author SHA1 Message Date
Álvaro Velad Galván b6a489ec17 ci: Allow detect when running in VM (#8380) 2025-04-02 13:50:03 +02:00
Álvaro Velad Galván 51db910192 ci: Add new shaka-bot argument to test on Android only (#8329) 2025-03-24 18:31:07 +01:00
Joey Parrish 3a47bd1c03 ci: Prevent leaked credentials (#8142)
Naive use of google-github-actions/auth and
google-github-actions/deploy-appengine can lead to leaked credentials.

In particular, uploading static content from the workspace root leads to
servable copies of the credentials file written by
google-github-actions/auth. This is exactly what the Shaka Player Demo
did. Making matters worse, google-github-actions/auth logs credential
filenames for all to see.

All uploaded credentials were expired before I uploaded this PR.

This fixes the leak by installing a gcloudignore file which prevents the
credentials from being uploaded.
2025-02-21 15:33:17 -08:00
Joey Parrish 9dbed29b97 ci: Handle screenshot updates with no changes (#8135)
If a maintainer requests screenshot updates in a new PR, but there are
no changes, simply don't create a PR.

Also adds logs to make it clear which path was taken.
2025-02-20 10:34:47 -08:00
Joey Parrish d5eab12cb6 ci: Only run Safari native layout tests in lab (#8120)
Native text layout in Safari renders differently on different devices,
OS versions, and with different OS a11y settings. Because this is so
inconsistent across devices, we now have a flag to explicity enable
native text layout tests on Safari. This flag will be used in our lab
only. Our lab tests on Safari will be the source of canonical results
for Safari layout tests.
2025-02-19 17:06:17 -08:00
Joey Parrish bbd16ca0d0 ci: Check if screenshot PR exists before creating new one (#8119)
This keeps the job from failing if a one-off PR for screenshots already
exists.
2025-02-19 10:19:05 -08:00
Joey Parrish f156cdc6c0 ci: Create a screenshot PR if no existing PR given (#8110) 2025-02-18 21:37:53 -08:00
Álvaro Velad Galván 9e0c05835f ci: Deploy nightly after push on main branch (#8069) 2025-02-13 06:25:52 +01:00
Álvaro Velad Galván 8c79388f81 build: Add new builds with only HLS or DASH (#8036)
Related to https://github.com/shaka-project/shaka-player/issues/8034

Compared to the current version without UI:

DASH -24,5% of size
HLS -19,5% of size
2025-02-07 13:38:58 +01:00
Joey Parrish fc33928f38 ci: Add Google TV Streamer in the lab (#8015) 2025-02-04 11:55:43 -08:00
Joey Parrish 2911f81623 ci: Fix secrets for version index workflow (#7906)
See also PR #7892 and #7900.
2025-01-17 11:11:02 -08:00
Joey Parrish db689f2fc8 ci: Fix trigger for version index workflow (#7900)
The `workflow_call` trigger is required to allow calling a workflow from
another with "uses:". The `schedule` trigger was always a workaround,
and should now be removed.

See also PR #7892.
2025-01-16 12:56:50 -08:00
Álvaro Velad Galván f31c6f015a ci: Fix demo index workflow runs too early when a release is made (#7892)
Fixes https://github.com/shaka-project/shaka-player/issues/7379
2025-01-16 10:59:25 +01:00
Álvaro Velad Galván 7407aca589 chore: Remove "Override Cast Receiver App ID" in the nightly workflow (#7894)
There is no need to do this anymore because we always use that ID in any
release
2025-01-15 20:23:42 +01:00
Joey Parrish 2fa04141f2 ci: Fix screenshot upload (#7876)
This is meant to fix errors like "Failed request: (409) Conflict: an
artifact with this name already exists on the workflow run" which occur
when more than one instance of a browser fails tests in the same run.

The change in behavior that led to the error likely began after updating
actions/upload-artifact.
2025-01-10 11:57:44 -08:00
Joey Parrish 984dbba65f ci: Update release-please-action (#7860)
google-github-actions/release-please-action has been deprecated and
replaced with googleapis/release-please-action.
2025-01-09 12:18:21 -08:00
Álvaro Velad Galván ae35e9bc31 ci: Increase "Build Player" timeout (#7850) 2025-01-08 20:15:30 +01:00
Joey Parrish 0313375837 ci: Update nodejs to a maintained version (#7784) 2024-12-19 22:10:35 -08:00
Joey Parrish de0f33c262 ci: Refactor screenshot workflow (#7773)
This workflow, triggerable only by maintainers, had some potential
security issues. This is a big refactor, and makes several changes:

 - Clean up description text (non-critical)
- Add granular permissions to set status (without this, the workflow was
broken since we changed default permissions)
- Split the update-pr job into commit-new-screenshots (unprivileged) and
update-pr (privileged as @shaka-bot)

The commit-new-screenshots job runs code that the PR author controls,
such as "npm ci" (controlled through package.json and
package-lock.json), and "./build/updateScreenshots.py" (easily edited to
do whatever). These steps could be used to do literally anything,
including modify tools in /usr/bin on the workflow VM that are needed by
the privileged steps.

By moving the privileged steps into a completely separate job, we can
ensure a clean slate without worrying about the VM's state. We only
transfer the .git/ folder between the two jobs. So the
commit-new-screenshots job will create the commit, and the update-pr job
will actually push that commit from a clean VM.

The job is once again functional, and for the first time, actually safe.
2024-12-18 08:26:15 -08:00
Shaka Bot 3d742fe160 chore: Sync common workflows (#7776)
This is an automated sync of common workflows for this organization.
The upstream source is:

https://github.com/shaka-project/shaka-github-tools/commit/be928d30615b0fed458e89efe538f75360557b0b

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2024-12-18 11:42:41 +01:00
Joey Parrish 7da1698e9b ci: Do not persist credentials after checkout (#7772)
See https://github.com/actions/checkout/issues/485 and
https://johnstawinski.com/2024/01/11/playing-with-fire-how-we-executed-a-critical-supply-chain-attack-on-pytorch/

In short, it is a terrible idea to persist even our default credentials
after checkout. There's no call for that, so we will now set
`persist-credentials: false` on all checkout actions.

The only exceptions are for the release job, which wants to push a tag
and create a branch, each of which explicitly persist credentials now
and explain why in a comment.
2024-12-18 08:50:10 +01:00
Joey Parrish 4302896623 ci: Use GitHub API directly to post PR coverage comments (#7758) 2024-12-13 09:30:52 -08:00
Joey Parrish 7dbdb372e4 ci: Update workflow permissions (#7731)
Now that default permissions are read-only, we must enable specific permissions for certain workflow jobs.

This fixes every job except "update screenshots", which has unresolved permissions issues.
2024-12-09 20:39:34 -08:00
Shaka Bot 51f09b6372 chore: Sync common workflows (#7730)
This is an automated sync of common workflows for this organization.
The upstream source is:
https://github.com/shaka-project/shaka-github-tools/commit/f0ad5ac78826f567c06076dbe8752eb2ec7f4579

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2024-12-09 16:14:27 -08:00
Álvaro Velad Galván 1d44f70ce4 ci: Fix coverage workflow run (#7715) 2024-12-04 09:16:28 -08:00
Álvaro Velad Galván 287008f90b ci: Add new shaka-bot commands (#7626) 2024-11-20 09:52:26 +01:00
Álvaro Velad Galván 997515a114 ci: Switch to use macos-latest (#7592)
Closes https://github.com/shaka-project/shaka-player/issues/6508
2024-11-14 18:41:23 +01:00
Joey Parrish ef9ba4f095 ci: Fix auto-branch job (#7586)
This uses very explicit ref names for both source and destination, to
fix this error during branch creation:

>   TAG=v4.12.0
>   BRANCH=$(echo "$TAG" | sed -e 's/\.0$/.x/')
>   git push origin HEAD:"$BRANCH"
>
> error: The destination you provided is not a full refname (i.e.,
> starting with "refs/"). We tried to guess what you meant by:
>
> - Looking for a ref that matches 'v4.12.x' on the remote side.
> - Checking if the <src> being pushed ('HEAD')
>   is a ref in "refs/{heads,tags}/". If so we add a corresponding
>   refs/{heads,tags}/ prefix on the remote side.
>
> Neither worked, so we gave up. You must fully qualify the ref.
> hint: The <src> part of the refspec is a commit object.
> hint: Did you mean to create a new branch by pushing to
> hint: 'HEAD:refs/heads/v4.12.x'?
> error: failed to push some refs to
'https://github.com/shaka-project/shaka-player'
> Error: Process completed with exit code 1.
2024-11-13 08:50:01 -08:00
Joey Parrish aafb522b78 ci: Fix status reporting on PRs (#7574)
To report commit status on a PR, the head commit must be used, not the
merge of that head back into the target (e.g. into main).

I would prefer to make status reporting special, so that we can run
tests and other operations against the merge (for more realistic results
and to avoid test failures that only show up after a merge). But this is
the quickest way for me to fix this critical feedback.
2024-11-13 08:18:40 +01:00
Álvaro Velad Galván 5315218484 ci: Add timeouts to avoid hangs on "Build and Test" workflow (#7561) 2024-11-08 10:47:43 +01:00
Álvaro Velad Galván 42bf0ca7d9 ci: Test Opera against macos-latest (#7558) 2024-11-07 19:35:23 +01:00
Joey Parrish 5dea918350 ci: Fix workflow events (#7544)
This was found by auditing workflows based on research published here:

https://github.com/joeyparrish/workflow-cheat-sheet

The research was prompted by a workflow bug in Shaka Streamer
2024-11-05 22:05:11 -08:00
Joey Parrish be0e10c084 ci: Fix test deflake (#7543)
Deflaking tests depends on an exact workflow name, but #7535 renamed the
test workflow. This syncs the name in the deflake workflow.
2024-11-05 12:42:57 -08:00
Álvaro Velad Galván 0f3b212b0d ci: Run "Build and Test" every midnight PST / 8am UTC (#7535) 2024-11-04 11:11:14 -08:00
Álvaro Velad Galván 38a6a3986d ci: Do not cancel other Selenium jobs (#7489)
Documentation:
https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
2024-10-24 12:29:50 +02:00
Joey Parrish afe7d37f3e ci: Do not cancel other Selenium jobs (#7463)
When we have two jobs queued for FirefoxWindows, for example, we want
one of them to wait, not cancel each other. The only time you would
cancel one is if the other is from the same branch/PR after an update.
Right now, only the browser name is used in the key, so we should never
cancel another job with the same key.

This fix lets us start tests for multiple release PRs at once.
2024-10-21 11:23:47 -07:00
Álvaro Velad Galván 630af7f690 ci: Test PR on Opera (#7366) 2024-09-25 09:26:51 +02:00
Joey Parrish 6d94d7482b ci: Allow concurrent lab runs that use different devices (#7298) 2024-09-13 09:31:02 +02:00
Joey Parrish 6c8ab370e9 ci: Fix SHA1 selection in lab run (#7299)
In #6811, I introduced a bug into the lab workflow. This came to my
attention through the GitHub Actions warning: "Unexpected input(s)
'sha', valid inputs are ...". This came from the "actions/checkout" step
of the "matrix config" job. The correct input is "ref", not "sha".

This bug meant that any changes to the matrix config were not being
properly tested. It's likely we haven't had any PRs that touched the
matrix config since the bug was introduced in June.
2024-09-13 09:30:31 +02:00
Álvaro Velad Galván e32ee6a1a9 ci: Increase selenium timeout to avoid timeouts in Tizen (#7287) 2024-09-11 17:02:06 +02:00
Álvaro Velad Galván 13450785ad ci: Reduce timeout minutes on test workflows (#6864) 2024-06-20 07:51:09 +02:00
Álvaro Velad Galván e613972b94 ci: Migrate Firefox from macos-13 to macos-latest (#6853)
Using arm (macos-latest) wherever possible reduces build times by 3
minutes.

We have a limited number of macos runners, so if we save time even on
Firefox alone (all we can do pending #6508), we can speed up the queue
of pending jobs across PRs.
2024-06-18 09:51:12 -07:00
Álvaro Velad Galván 69dfb20b28 ci: Remove ChromecastHub from shaka bot commands (#6852)
ChromecastHub is currently disabled, so we don't want to trigger it explicitly on `test ce` commands.
2024-06-18 09:43:07 -07:00
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