Skip to content

Commit

Permalink
Merge branch 'devel' into nginx-http3
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Aug 9, 2024
2 parents 05d8a31 + bf26bab commit 2535dd0
Show file tree
Hide file tree
Showing 46 changed files with 7,641 additions and 1,407 deletions.
20 changes: 0 additions & 20 deletions .eslintrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/auto-merge-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.3
uses: dependabot/fetch-metadata@v2.2.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
DOCKER_TAG: ghcr.io/macbre/phantomas:latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build the Docker image with ${{ env.DOCKER_TAG }} tag
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
tags: ${{ env.DOCKER_TAG }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: latest
cache: npm

- name: Install dependencies
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
npm-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

#
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-npm
#
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '14.x'
node-version: 'latest'
registry-url: 'https://npm.pkg.github.com'

# GitHub Packages only supports scoped npm packages.
Expand All @@ -36,9 +36,9 @@ jobs:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}


- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '14.x'
node-version: 'latest'
registry-url: 'https://registry.npmjs.org'

- name: Publish to npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-to-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: "ubuntu-20.04"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build and publish a Docker image for ${{ github.repository }}
uses: macbre/push-to-ghcr@master
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,31 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x, 17.x, 18.x]
# https://github.com/nodejs/release#release-schedule
# https://github.com/actions/setup-node#supported-version-syntax
node-version:
- "lts/*"
- "latest"

services:
# https://github.com/postmanlabs/httpbin
# https://httpbin.org/
httpbin:
image: kennethreitz/httpbin
ports:
- "5555:80"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{ matrix.node-version }}

- name: Log the Node.js version used
run: echo "::notice::Using Node.js $( node -v)"

- name: Install dependencies
run: npm ci

Expand Down Expand Up @@ -67,7 +82,7 @@ jobs:
# upload coverage report for just one of Node.js version matrix runs
- name: Upload coverage report to Coveralls
if: matrix.node-version == '16.x'
uses: coverallsapp/github-action@1.1.3
uses: coverallsapp/github-action@v2.3.0
continue-on-error: true
with:
github-token: ${{ github.token }}
Expand Down
93 changes: 0 additions & 93 deletions .github/workflows/upgrade-puppeteer.yml

This file was deleted.

12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ COPY package.json .
COPY package-lock.json .
RUN npm ci

# TODO: find the chrome binary and symlink it to the PATH
RUN ldd $(find . -wholename '*chrome-linux/chrome') && \
$(find . -wholename '*chrome-linux/chrome') --version
# find the chrome binary and symlink it to the PATH
# e.g. ./.cache/puppeteer/chrome/linux-112.0.5615.121/chrome-linux64/chrome
RUN echo "Chrome found in: " $(find . -wholename '*chrome-linux64/chrome') && \
ln -s $(find . -wholename '*chrome-linux64/chrome') .

ENV PATH ${PATH}":/opt/phantomas"

RUN ldd chrome && \
chrome --version

ARG GITHUB_SHA="dev"
ENV COMMIT_SHA ${GITHUB_SHA}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ phantomas

## Requirements

* [NodeJS](http://nodejs.org) 14+
* [NodeJS](http://nodejs.org) 16+

## Installation

Expand Down
3 changes: 1 addition & 2 deletions bin/phantomas.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ let options = parseArgv(process.argv);
if (typeof options.url !== "string" && typeof options.config === "undefined") {
debug("URL not provided - show help and leave");
getProgram().outputHelp();
process.exitCode = 1;
return;
process.exit(1);
}

url = options.url;
Expand Down
1 change: 1 addition & 0 deletions bin/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function getProgram() {

// Output and reporting
.option("--analyze-css", "emit in-depth CSS metrics")
.option("--analyze-images", "emit in-depth image metrics")
.option("--colors", "forces ANSI colors even when output is piped")
.option(
"--film-strip",
Expand Down
3 changes: 2 additions & 1 deletion core/modules/requestsMonitor/requestsMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function parseEntryUrl(entry) {
entry.protocol = false;
entry.isBlob = true;
} else {
parsed = new URL(entry.url) || {};
parsed = new URL(entry.url);

entry.protocol = parsed.protocol.replace(":", ""); // e.g. "http:"
entry.domain = parsed.hostname;
Expand Down Expand Up @@ -97,6 +97,7 @@ function addContentType(headerValue, entry) {
case "image/gif":
case "image/svg+xml":
case "image/webp":
case "image/avif":
entry.type = "image";
entry.isImage = true;

Expand Down
3 changes: 2 additions & 1 deletion core/scope.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* phantomas browser "scope" with helper code
*
* Code below is executed in page's "scope" (injected by lib/browser.js)
* Code below is executed in page's "scope" (injected by the scope.injectJs() helper)
*/
/* istanbul ignore next */
(function coreScope(scope) {
Expand Down Expand Up @@ -114,6 +114,7 @@
console,
"log:" + stringify(Array.prototype.slice.call(arguments))
);
// eslint-disable-next-line no-empty
} catch (e) {}
};

Expand Down
Loading

0 comments on commit 2535dd0

Please sign in to comment.