Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
needs: [build]
strategy:
matrix:
os: ${{ github.actor == 'dependabot[bot]' && fromJson('["ubuntu"]') || fromJson('["ubuntu", "macos", "windows"]') }}
os: ${{ github.actor == 'dependabot[bot]' && fromJson('["ubuntu-latest"]') || fromJson('["ubuntu-latest", "macos-latest", "windows-latest"]') }}
version: ["", 1295939, 120, dev, latest]
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6

Expand Down Expand Up @@ -58,6 +58,22 @@ jobs:
(Get-Item (Get-Command "${{ steps.setup-chrome.outputs.chrome-path }}").Source).VersionInfo.ProductVersion
(Get-Item (Get-Command "${{ steps.setup-chrome.outputs.chromedriver-path }}").Source).VersionInfo.ProductVersion

test-linux-arm:
needs: [build]
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6

- name: Install Google Chrome
uses: ./
with:
chrome-version: canary
install-chromedriver: true
id: setup-chrome
- run: |
"${{ steps.setup-chrome.outputs.chrome-path }}" --version
"${{ steps.setup-chrome.outputs.chromedriver-path }}" --version

test-install-dependencies:
needs: [build]
strategy:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/manual-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
required: true
type: choice
options:
- ubuntu
- windows
- macos
- ubuntu-latest
- windows-latest
- macos-latest
- ubuntu-24.04-arm
Comment thread
amanstep marked this conversation as resolved.
container:
description: 'Container image to run test on'
required: false
Expand All @@ -35,14 +36,15 @@ jobs:

test:
needs: [build]
runs-on: ${{ inputs.os }}-latest
runs-on: ${{ inputs.os }}
container: ${{ inputs.container }}
steps:
- uses: actions/checkout@v6
- name: Install chrome
uses: ./
with:
chrome-version: ${{ inputs.chrome-version }}
install-chromedriver: true
id: setup-chrome
- if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ steps:

## Supported platforms

| | Linux x64 | Mac x64 | Mac Arm64 | Windows | Windows Arm64 |
| --- | --- | --- | --- | --- | --- |
| Channel name (e.g. `stable`) | ✅ | ✅ | ✅ | ✅ | ❌ |
| Commit position (e.g. `1295939`) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Specific version (e.g. `120.0.6099`) | ✅ | ✅ | ✅ | ✅ | ❌ |
| Latest snapshot | ✅ | ✅ | ✅ | ✅ | ✅ |
| | Linux x64 | Linux ARM64 | Mac x64 | Mac Arm64 | Windows | Windows Arm64 |
| --- | --- | --- | --- | --- | --- | --- |
| Channel name (e.g. `stable`) | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Commit position (e.g. `1295939`) | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| Specific version (e.g. `120.0.6099`) | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Latest snapshot | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |

## License

Expand Down
41 changes: 34 additions & 7 deletions __test__/chrome_for_testing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ describe("KnownGoodVersionResolver", () => {
});

test.each`
spec | version | browserURL | driverURL
${"120.0.6099.5"} | ${"120.0.6099.5"} | ${"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.5/linux64/chrome-linux64.zip"} | ${"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.5/linux64/chromedriver-linux64.zip"}
${"120.0.6099.x"} | ${"120.0.6099.56"} | ${"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.56/linux64/chrome-linux64.zip"} | ${"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.56/linux64/chromedriver-linux64.zip"}
${"1234.0.6099.x"} | ${undefined} | ${undefined} | ${undefined}
spec | version | browserURL | driverURL
${"120.0.6099.5"} | ${"120.0.6099.5"} | ${"https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.5/linux64/chrome-linux64.zip"} | ${"https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.5/linux64/chromedriver-linux64.zip"}
${"120.0.6099.x"} | ${"120.0.6099.109"} | ${"https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.109/linux64/chrome-linux64.zip"} | ${"https://storage.googleapis.com/chrome-for-testing-public/120.0.6099.109/linux64/chromedriver-linux64.zip"}
${"1234.0.6099.x"} | ${undefined} | ${undefined} | ${undefined}
`(
"should resolve known good versions for $spec",
async ({ spec, version, browserURL, driverURL }) => {
Expand Down Expand Up @@ -70,7 +70,21 @@ describe("KnownGoodVersionResolver", () => {
const resolved2 = await resolver.resolveBrowserOnly("113.0.5672.0");
expect(resolved2?.version).toEqual("113.0.5672.0");
expect(resolved2?.browserDownloadURL).toEqual(
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/113.0.5672.0/linux64/chrome-linux64.zip",
"https://storage.googleapis.com/chrome-for-testing-public/113.0.5672.0/linux64/chrome-linux64.zip",
);
});
test("should resolve known good versions for linux arm64", async () => {
const resolver = new KnownGoodVersionResolver({
os: "linux",
arch: "arm64",
});
const resolved = await resolver.resolveBrowserAndDriver("153.0.8001.0");
expect(resolved?.version).toEqual("153.0.8001.0");
expect(resolved?.browserDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/153.0.8001.0/linux-arm64/chrome-linux-arm64.zip",
);
expect(resolved?.driverDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/153.0.8001.0/linux-arm64/chromedriver-linux-arm64.zip",
);
});

Expand Down Expand Up @@ -107,10 +121,23 @@ describe("LastKnownGoodVersionResolver", () => {
});
const resolved = await resolver.resolve("stable");
expect(resolved?.browserDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.78/linux64/chrome-linux64.zip",
"https://storage.googleapis.com/chrome-for-testing-public/152.0.7977.42/linux64/chrome-linux64.zip",
);
expect(resolved?.driverDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/152.0.7977.42/linux64/chromedriver-linux64.zip",
);
});
test("should resolve last known good versions for linux arm64", async () => {
const resolver = new LastKnownGoodVersionResolver({
os: "linux",
arch: "arm64",
});
const resolved = await resolver.resolve("canary");
expect(resolved?.browserDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/153.0.8009.0/linux-arm64/chrome-linux-arm64.zip",
);
expect(resolved?.driverDownloadURL).toEqual(
"https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.78/linux64/chromedriver-linux64.zip",
"https://storage.googleapis.com/chrome-for-testing-public/153.0.8009.0/linux-arm64/chromedriver-linux-arm64.zip",
);
});

Expand Down
2 changes: 1 addition & 1 deletion __test__/data/known-good-versions-with-downloads.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion __test__/data/last-known-good-versions-with-downloads.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions __test__/version_installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ describe("KnownGoodVersionInstaller", () => {

test("checkInstalledBrowser should return installed path if installed", async () => {
cacheFindSpy.mockResolvedValue(
"/opt/hostedtoolcache/setup-chrome/chrome/120.0.6099.56/x64",
"/opt/hostedtoolcache/setup-chrome/chrome/120.0.6099.109/x64",
);

const installed = await installer.checkInstalledBrowser("120.0.6099.x");
expect(installed?.root).toEqual(
"/opt/hostedtoolcache/setup-chrome/chrome/120.0.6099.56/x64",
"/opt/hostedtoolcache/setup-chrome/chrome/120.0.6099.109/x64",
);
expect(cacheFindSpy).toHaveBeenCalledWith("chrome", "120.0.6099.x");
});
Expand All @@ -75,7 +75,7 @@ describe("KnownGoodVersionInstaller", () => {
expect(cacheCacheDirSpy).toHaveBeenCalledWith(
"/tmp/extracted/chrome-linux64",
"chrome",
"120.0.6099.56",
"120.0.6099.109",
);
});

Expand All @@ -88,12 +88,12 @@ describe("KnownGoodVersionInstaller", () => {

test("checkInstalledDriver should return installed path if installed", async () => {
cacheFindSpy.mockResolvedValue(
"/opt/hostedtoolcache/setup-chrome/chromedriver/120.0.6099.56/x64",
"/opt/hostedtoolcache/setup-chrome/chromedriver/120.0.6099.109/x64",
);

const installed = await installer.checkInstalledDriver("120.0.6099.x");
expect(installed?.root).toEqual(
"/opt/hostedtoolcache/setup-chrome/chromedriver/120.0.6099.56/x64",
"/opt/hostedtoolcache/setup-chrome/chromedriver/120.0.6099.109/x64",
);
expect(cacheFindSpy).toHaveBeenCalledWith("chromedriver", "120.0.6099.x");
});
Expand Down Expand Up @@ -134,7 +134,7 @@ describe("KnownGoodVersionInstaller", () => {
expect(cacheCacheDirSpy).toHaveBeenCalledWith(
"/tmp/extracted/chromedriver-linux64",
"chromedriver",
"120.0.6099.56",
"120.0.6099.109",
);
});

Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"preset": "recommended",
"complexity": {
"useLiteralKeys": "off"
},
Expand Down
10 changes: 6 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35789,6 +35789,9 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/asset-relocator-loader */
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = decodeURIComponent(new URL('.', import.meta.url).pathname).slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
/******/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
Expand Down Expand Up @@ -35859,10 +35862,6 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
/******/
/************************************************************************/
var __webpack_exports__ = {};

Expand Down Expand Up @@ -47709,6 +47708,9 @@ const platformString = (platform) => {
if (platform.os === OS.LINUX && platform.arch === Arch.AMD64) {
return "linux64";
}
else if (platform.os === OS.LINUX && platform.arch === Arch.ARM64) {
return "linux-arm64";
}
else if (platform.os === OS.DARWIN && platform.arch === Arch.AMD64) {
return "mac-x64";
}
Expand Down
Loading
Loading