From 690ae983367bf112d94cd32be633d54065c68cf6 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 31 May 2022 11:56:19 -0700 Subject: [PATCH] add lighthouse smoketests (windows) to CI (#265) --- .github/workflows/lh-smoke.yml | 47 ++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lh-smoke.yml diff --git a/.github/workflows/lh-smoke.yml b/.github/workflows/lh-smoke.yml new file mode 100644 index 000000000..1001d3e25 --- /dev/null +++ b/.github/workflows/lh-smoke.yml @@ -0,0 +1,47 @@ +name: smoke + +on: + push: + branches: [master] + pull_request: # run on all PRs, not just PRs to a particular branch + +jobs: + # Only run smoke tests for windows against stable chrome. + lh-smoke-windows: + strategy: + matrix: + smoke-test-shard: [1, 2] + # e.g. if set 1 fails, continue with set 2 anyway + fail-fast: false + runs-on: windows-latest + name: Windows smoke ${{ matrix.smoke-test-shard }}/2 + + steps: + - name: git clone + uses: actions/checkout@v2 + + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + + # chrome-launcher + # This'll add lighthouse AND install chrome-launcher's deps + - run: yarn add --frozen-lockfile --network-timeout 1000000 -D https://github.com/GoogleChrome/lighthouse.git#master + - run: yarn build + + # lighthouse + - run: yarn --cwd node_modules/lighthouse/ install --frozen-lockfile --network-timeout 1000000 + - run: yarn reset-link + - run: yarn --cwd node_modules/lighthouse/ build-report + + - name: Run smoke tests + # Windows bots are slow, so only run enough tests to verify matching behavior. + run: yarn --cwd node_modules/lighthouse/ smoke --debug -j=2 --retries=5 --shard=${{ matrix.smoke-test-shard }}/2 dbw oopif offline lantern metrics + + - name: Upload failures + if: failure() + uses: actions/upload-artifact@v1 + with: + name: Smokehouse (windows) + path: node_modules/lighthouse/.tmp/smokehouse-ci-failures/ diff --git a/package.json b/package.json index 5631b230b..092ec3d39 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "test-formatting": "test/check-formatting.sh", "format": "scripts/format.sh", "type-check": "tsc --allowJs --checkJs --noEmit --target es2019 *.js", - "prepublishOnly": "npm run build && npm run test" + "prepublishOnly": "npm run build && npm run test", + "reset-link": "(yarn unlink || true) && yarn link && yarn --cwd node_modules/lighthouse/ link chrome-launcher" }, "bin": { "print-chrome-path": "bin/print-chrome-path.js"