Skip to content

Skip screenshot tests in CI #2348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6c178b2
skip webpack
nbierdeman Feb 28, 2024
78b30ef
ci failed -> webpack is cool again
nbierdeman Feb 28, 2024
174356d
skip jest screenshot tests
nbierdeman Feb 28, 2024
02c01e7
only run webpack and jest screenshot tests
nbierdeman Feb 28, 2024
8ef2d1e
yep, jest screenshot tests break ci
nbierdeman Feb 28, 2024
43a00f2
let's see what happens when grabthar-release is upgraded
nbierdeman Feb 28, 2024
6fa35cb
seems like we're stuck with grabthar-release v1.0.69
nbierdeman Feb 28, 2024
ca7e04f
what happens when we remove an event listener?
nbierdeman Feb 28, 2024
404a37d
the event listener was not the culprit
nbierdeman Feb 28, 2024
14036cc
what if we run jest without the env option?
nbierdeman Feb 28, 2024
80d668a
nah, the env option was fine
nbierdeman Feb 28, 2024
e53676a
try ci option
nbierdeman Feb 28, 2024
0fc9f62
nah, the ci option didn't work
nbierdeman Feb 28, 2024
009f491
add --help to jest
nbierdeman Feb 29, 2024
d84f2b8
yep, CI executes jest --help
nbierdeman Feb 29, 2024
43dc38b
setup new gh actions task for jest screenshots
nbierdeman Feb 29, 2024
5c121bc
remove flow since it keeps failing now that screenshots are a separat…
nbierdeman Feb 29, 2024
544f639
the separate screenshot task still hung
nbierdeman Feb 29, 2024
bd1e77b
add screenshot test logs
nbierdeman Feb 29, 2024
ff06bce
add more screenshot logs
nbierdeman Feb 29, 2024
21b02db
even more screenshot logs
nbierdeman Feb 29, 2024
7ddac55
start from the top
nbierdeman Mar 1, 2024
05d5a0f
remove npm run buttondiff from 'test'
nbierdeman Mar 1, 2024
f2b6669
skip flow
nbierdeman Mar 1, 2024
6b66e43
remove condition
nbierdeman Mar 1, 2024
a844c08
fix flow
wsbrunson Mar 1, 2024
7080daa
break up tasks in main.yml
wsbrunson Mar 1, 2024
160303a
fix yml
wsbrunson Mar 1, 2024
1925cb3
remove matrix
wsbrunson Mar 1, 2024
e27fccf
whoops lol
wsbrunson Mar 1, 2024
dfc3664
run screenshot tests in separate action
nbierdeman Mar 1, 2024
33420a2
try running a single screenshot test in ci
nbierdeman Mar 5, 2024
faf0400
double timeout time
nbierdeman Mar 5, 2024
78c698d
nah, doubling the jest timeout didn't work
nbierdeman Mar 5, 2024
610defa
add setupBrowserPage log
nbierdeman Mar 5, 2024
ef2fc17
use async/await in beforeAll
nbierdeman Mar 5, 2024
e9ddb37
remove beforeAll
nbierdeman Mar 5, 2024
b9a5e8a
add beforeAll
nbierdeman Mar 5, 2024
fcef504
remove iffy IIFE
nbierdeman Mar 5, 2024
15d0d89
add iffy IIFE back in
nbierdeman Mar 6, 2024
cfa5d14
more setupBrowserPage logs
nbierdeman Mar 6, 2024
251cd35
more logs
nbierdeman Mar 6, 2024
c210e13
more logs
nbierdeman Mar 6, 2024
0c2787c
remove setupBrowserPage for...of loop
nbierdeman Mar 6, 2024
3e252df
remove setupBrowserPage page.evaluate()
nbierdeman Mar 6, 2024
b01af7d
remove async/await from beforeAll
nbierdeman Mar 6, 2024
5f30830
revert beforeAll to original state
nbierdeman Mar 6, 2024
c3490a9
revert screenshot tests to original state
nbierdeman Mar 6, 2024
e92be05
skip screenshot tests in ci
nbierdeman Mar 6, 2024
3b65e28
remove config
nbierdeman Mar 6, 2024
24559a5
add more scripts to test script
nbierdeman Mar 6, 2024
802c81c
add husky
nbierdeman Mar 6, 2024
20a9cbe
example comment
nbierdeman Mar 6, 2024
b915736
add husky pre-push
nbierdeman Mar 6, 2024
6a3fbee
remove husky object
nbierdeman Mar 6, 2024
53af196
remove test comment
nbierdeman Mar 6, 2024
0ce5bd6
run screenshot tests in pre-push hook
nbierdeman Mar 6, 2024
3944af6
skip pre-push hook in ci
nbierdeman Mar 6, 2024
eb9abd9
use exit code from npm run buttondiff
nbierdeman Mar 6, 2024
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
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[ignore]
.*/node_modules/es-abstract
.*/node_modules/grabthar-release
.*/node_modules/@babel/core
.*/node_modules/@babel/helper-define-polyfill-provider
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,39 @@ on:
jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14]
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
node-version: "14"

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: ▶️ Run lint
run: npm run lint

- name: ▶️ Run flow-typed script
run: npm run flow-typed

- name: ▶️ Run flow
run: npm run flow

- name: ▶️ Run test-ssr
run: npm run test-ssr

- name: ▶️ Run karma
run: npm run karma

# The screenshot tests break in CI, but work locally
# - name: ▶️ Run screenshot tests
# run: npm run buttondiff

- name: ▶️ Run build script
run: npm run build

Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: 🤝 Set Node version from .nvmrc
run: echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV

- name: ⎔ Setup node
# sets up the .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: "14"
registry-url: "https://registry.npmjs.org"

- name: 📥 Download deps
Expand All @@ -35,4 +32,4 @@ jobs:
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
12 changes: 12 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Check if not running in GitHub Actions
if [ -z "$CI" ]; then
echo "Running pre-push hook in local environment"
npm run buttondiff
exit 0
else
echo "Skipping pre-push hook in CI environment"
exit 0
fi
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"flow:build": "flow gen-flow-files ./src/index.js --out-dir ./dist/module",
"karma": "cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start",
"babel": "babel src/ --out-dir dist/module",
"webpack": "babel-node ./node_modules/.bin/webpack --progress",
"webpack": "babel-node ./node_modules/.bin/webpack",
"webpack-base": "babel-node ./node_modules/.bin/webpack --progress --config webpack.base.config.js",
"webpack-button": "babel-node ./node_modules/.bin/webpack --progress --config webpack.button.config.js",
"test": "if [ ! $SKIP_TEST ]; then npm run lint && npm run flow-typed && npm run flow && npm run test-ssr && npm run karma && npm run buttondiff; fi;",
"build": "npm run test && npm run webpack",
"test": "npm run lint && npm run flow-typed && npm run flow && npm run test-ssr && npm run karma && npm run buttondiff",
"build": "npm run webpack",
"release": "./scripts/publish.sh",
"release:patch": "./scripts/publish.sh patch",
"release:minor": "./scripts/publish.sh minor",
Expand Down Expand Up @@ -73,6 +73,7 @@
"fs-extra": "^4.0.2",
"grabthar-release": "1.0.69",
"grumbler-scripts": "^3",
"husky": "^7.0.4",
"imagemagick": "^0.1.3",
"imgur": "^0.2.1",
"memory-fs": "^0.4.1",
Expand Down
Loading