Skip to content

Commit

Permalink
Fix GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
smcjones committed Jul 23, 2024
1 parent befebb6 commit 22097c6
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 113 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint everything
name: General Repo Health and Test Status

on:
push:
Expand All @@ -15,10 +15,10 @@ jobs:
- name: Set bash to strict mode
run: set -euox pipefail

- name: Set Node.js 18.x
- name: Set Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 22.x

- name: Install yarn
run: npm -g install yarn
Expand All @@ -29,12 +29,15 @@ jobs:
- name: Lint
run: npx yarn lint-staged

- name: Test
run: npx yarn test

- name: Print errors
run: find . -name "*.warn" -type f -exec cat {} \;

- name: Fail on errors
if: ${{ steps.lint.outputs.error || steps.test.outputs.error || steps.build-sa360.outputs.error || steps.build-dv360.outputs.error || steps.build-dev-sa360.outputs.error }}
run: exit 1

- name: Build
run: npx yarn playwright install

- name: Test everything
run: npx yarn test
8 changes: 4 additions & 4 deletions .github/workflows/dv360.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build and test DV360
name: DV360 Build

on:
push:
branches:
- main

jobs:
lint-and-test:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -15,10 +15,10 @@ jobs:
- name: Set bash to strict mode
run: set -euox pipefail

- name: Set Node.js 18.x
- name: Set Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 22.x

- name: Install yarn
run: npm -g install yarn
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sa360.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build and test SA360
name: SA360 Build

on:
push:
branches:
- main

jobs:
lint-and-test:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -15,10 +15,10 @@ jobs:
- name: Set bash to strict mode
run: set -euox pipefail

- name: Set Node.js 18.x
- name: Set Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 22.x

- name: Install yarn
run: npm -g install yarn
Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn
yarn playwright install
yarn test
yarn lint-staged
npx tsc -p .
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ in getting this solution to work for you.

## Status

![General Build Status](https://github.com/google-marketing-solutions/margin-protection/actions/workflows/build.yaml/badge.svg)
![Whole Repository Health](https://github.com/google-marketing-solutions/margin-protection/actions/workflows/build.yaml/badge.svg)

![SA360 Launch Monitor Build & Test](https://github.com/google-marketing-solutions/margin-protection/actions/workflows/sa360.yaml/badge.svg)

![DV360 Launch Monitor Build & Test](https://github.com/google-marketing-solutions/margin-protection/actions/workflows/dv360.yaml/badge.svg)

## Problem
Expand Down
2 changes: 1 addition & 1 deletion dv360/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"push": "yarn build:dev && clasp push",
"push:prod": "yarn build:prod && clasp push",
"push:client": "yarn --cwd ../client push",
"test": "web-test-runner --config web-test-runner.mjs"
"test": "web-test-runner --config ../web-test-runner.mjs"
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
},
"prettier": {
"singleQuote": true
},
"dependencies": {
"@web/test-runner-playwright": "^0.11.0"
}
}
2 changes: 1 addition & 1 deletion sa360/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"push": "yarn build:dev && clasp push",
"push:prod": "yarn build:prod && clasp push",
"push:client": "yarn --cwd ../client push",
"test": "web-test-runner --config web-test-runner.mjs"
"test": "web-test-runner --config ../web-test-runner.mjs"
}
}
4 changes: 4 additions & 0 deletions web-test-runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { fromRollup } from '@web/dev-server-rollup';
import { typescriptPaths } from 'rollup-plugin-typescript-paths';
import { fileURLToPath } from 'url';
import { jasmineTestRunnerConfig } from 'web-test-runner-jasmine';
import { playwrightLauncher } from '@web/test-runner-playwright';

import * as os from 'os';

Expand All @@ -25,4 +26,7 @@ export default {
tsconfig: fileURLToPath(new URL('./tsconfig.json', import.meta.url)),
}),
],
browsers: [
playwrightLauncher({ product: 'chromium' })
]
};
126 changes: 30 additions & 96 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
lodash.assignwith "^4.2.0"
typical "^7.1.1"

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.11":
"@babel/code-frame@^7.12.11":
version "7.24.7"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz"
integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==
Expand Down Expand Up @@ -704,6 +704,15 @@
dependencies:
"@web/test-runner-core" "^0.13.0"

"@web/test-runner-playwright@^0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@web/test-runner-playwright/-/test-runner-playwright-0.11.0.tgz#6450dead573aca406ddf26f93471c776b1f98fcb"
integrity sha512-s+f43DSAcssKYVOD9SuzueUcctJdHzq1by45gAnSCKa9FQcaTbuYe8CzmxA21g+NcL5+ayo4z+MA9PO4H+PssQ==
dependencies:
"@web/test-runner-core" "^0.13.0"
"@web/test-runner-coverage-v8" "^0.8.0"
playwright "^1.22.2"

"@web/test-runner@^0.18.1", "@web/test-runner@^0.18.2":
version "0.18.2"
resolved "https://registry.npmjs.org/@web/test-runner/-/test-runner-0.18.2.tgz"
Expand Down Expand Up @@ -790,11 +799,6 @@ anymatch@~3.1.2:
normalize-path "^3.0.0"
picomatch "^2.0.4"

argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

array-back@^3.0.1, array-back@^3.1.0:
version "3.1.0"
resolved "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz"
Expand Down Expand Up @@ -950,11 +954,6 @@ call-bind@^1.0.7:
get-intrinsic "^1.2.4"
set-function-length "^1.2.1"

callsites@^3.0.0:
version "3.1.0"
resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz"
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==

camelcase@^6.2.0:
version "6.3.0"
resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz"
Expand Down Expand Up @@ -1159,16 +1158,6 @@ cookies@~0.9.0:
depd "~2.0.0"
keygrip "~1.1.0"

cosmiconfig@^9.0.0:
version "9.0.0"
resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz"
integrity sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==
dependencies:
env-paths "^2.2.1"
import-fresh "^3.3.0"
js-yaml "^4.1.0"
parse-json "^5.2.0"

cross-spawn@^7.0.0, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
Expand Down Expand Up @@ -1328,18 +1317,6 @@ end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"

env-paths@^2.2.1:
version "2.2.1"
resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz"
integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==

error-ex@^1.3.1:
version "1.3.2"
resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz"
integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
dependencies:
is-arrayish "^0.2.1"

errorstacks@^2.2.0:
version "2.4.1"
resolved "https://registry.npmjs.org/errorstacks/-/errorstacks-2.4.1.tgz"
Expand Down Expand Up @@ -1559,6 +1536,11 @@ fs-extra@^11.2.0:
jsonfile "^6.0.1"
universalify "^2.0.0"

fsevents@2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==

fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
Expand Down Expand Up @@ -1801,14 +1783,6 @@ ignore@^5.2.0:
resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz"
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==

import-fresh@^3.3.0:
version "3.3.0"
resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz"
integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==
dependencies:
parent-module "^1.0.0"
resolve-from "^4.0.0"

inflation@^2.0.0:
version "2.1.0"
resolved "https://registry.npmjs.org/inflation/-/inflation-2.1.0.tgz"
Expand Down Expand Up @@ -1852,11 +1826,6 @@ ipaddr.js@^1.9.1:
resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz"
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==

is-arrayish@^0.2.1:
version "0.2.1"
resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz"
integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==

is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz"
Expand Down Expand Up @@ -2012,23 +1981,11 @@ js-tokens@^4.0.0:
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"

jsbn@1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz"
integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==

json-parse-even-better-errors@^2.3.0:
version "2.3.1"
resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz"
integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==

jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz"
Expand Down Expand Up @@ -2124,11 +2081,6 @@ lilconfig@~3.1.1:
resolved "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz"
integrity sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==

lines-and-columns@^1.1.6:
version "1.2.4"
resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

lint-staged@^15.2.7:
version "15.2.7"
resolved "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.7.tgz"
Expand Down Expand Up @@ -2446,23 +2398,6 @@ package-json-from-dist@^1.0.0:
resolved "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz"
integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==

parent-module@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz"
integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
dependencies:
callsites "^3.0.0"

parse-json@^5.2.0:
version "5.2.0"
resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz"
integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==
dependencies:
"@babel/code-frame" "^7.0.0"
error-ex "^1.3.1"
json-parse-even-better-errors "^2.3.0"
lines-and-columns "^1.1.6"

parse5@^6.0.1:
version "6.0.1"
resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz"
Expand Down Expand Up @@ -2526,6 +2461,20 @@ pidtree@~0.6.0:
resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz"
integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==

playwright-core@1.45.3:
version "1.45.3"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.45.3.tgz#e77bc4c78a621b96c3e629027534ee1d25faac93"
integrity sha512-+ym0jNbcjikaOwwSZycFbwkWgfruWvYlJfThKYAlImbxUgdWFO2oW70ojPm4OpE4t6TAo2FY/smM+hpVTtkhDA==

playwright@^1.22.2:
version "1.45.3"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.45.3.tgz#75143f73093a6e1467f7097083d2f0846fb8dd2f"
integrity sha512-QhVaS+lpluxCaioejDZ95l4Y4jSFCsBvl2UZkpeXlzxmqS+aABr5c82YmfMHrL6x27nvrvykJAFpkzT2eWdJww==
dependencies:
playwright-core "1.45.3"
optionalDependencies:
fsevents "2.3.2"

portfinder@^1.0.32:
version "1.0.32"
resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz"
Expand Down Expand Up @@ -2577,7 +2526,7 @@ punycode@^2.3.1:
resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz"
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==

puppeteer-core@22.13.1, puppeteer-core@^22.0.0:
puppeteer-core@^22.0.0:
version "22.13.1"
resolved "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.13.1.tgz"
integrity sha512-NmhnASYp51QPRCAf9n0OPxuPMmzkKd8+2sB9Q+BjwwCG25gz6iuNc3LQDWa+cH2tyivmJppLhNNFt6Q3HmoOpw==
Expand All @@ -2588,16 +2537,6 @@ puppeteer-core@22.13.1, puppeteer-core@^22.0.0:
devtools-protocol "0.0.1299070"
ws "^8.18.0"

puppeteer@^22.13.1:
version "22.13.1"
resolved "https://registry.npmjs.org/puppeteer/-/puppeteer-22.13.1.tgz"
integrity sha512-PwXLDQK5u83Fm5A7TGMq+9BR7iHDJ8a3h21PSsh/E6VfhxiKYkU7+tvGZNSCap6k3pCNDd9oNteVBEctcBalmQ==
dependencies:
"@puppeteer/browsers" "2.2.4"
cosmiconfig "^9.0.0"
devtools-protocol "0.0.1299070"
puppeteer-core "22.13.1"

qs@^6.5.2:
version "6.12.3"
resolved "https://registry.npmjs.org/qs/-/qs-6.12.3.tgz"
Expand Down Expand Up @@ -2637,11 +2576,6 @@ require-directory@^2.1.1:
resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz"
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==

resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz"
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==

resolve-path@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz"
Expand Down

0 comments on commit 22097c6

Please sign in to comment.