Skip to content

Commit f3b98e6

Browse files
authored
Tests: replace karma and testswarm with jQuery test runner
- add GH workflow for updating git files on filestash - selenium is having an issue starting safaridriver when loading esmodules. Retries succeed, but inconsistently. Leaving that out for now. - run both dev and min migrate on every supported jQuery version. - upgrade all dependencies, but lock uglify to a version that supports the `ie8` argument. Close gh-503
1 parent 2a7bfd6 commit f3b98e6

39 files changed

+4810
-6360
lines changed

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ end_of_line = lf
99
charset = utf-8
1010
trim_trailing_whitespace = true
1111
insert_final_newline = true
12+
13+
[*.{yml}]
14+
indent_style = space
15+
indent_size = 2
+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Browserstack (Core 3.x)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
environment: browserstack
12+
env:
13+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
14+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
15+
NODE_VERSION: 20.x
16+
name: ${{ matrix.BROWSER }}
17+
concurrency:
18+
group: ${{ matrix.BROWSER }}
19+
timeout-minutes: 30
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
BROWSER:
24+
- 'IE_11'
25+
- 'IE_10'
26+
- 'IE_9'
27+
- 'Safari_latest'
28+
- 'Safari_latest-1'
29+
- 'Chrome_latest'
30+
- 'Chrome_latest-1'
31+
- 'Opera_latest'
32+
- 'Edge_latest'
33+
- 'Edge_latest-1'
34+
- 'Edge_18'
35+
- 'Firefox_latest'
36+
- 'Firefox_latest-1'
37+
- 'Firefox_115'
38+
- 'Firefox_102'
39+
- 'Firefox_91'
40+
- 'Firefox_78'
41+
- 'Firefox_60'
42+
- 'Firefox_48'
43+
- '__iOS_17'
44+
- '__iOS_16'
45+
- '__iOS_15'
46+
- '__iOS_14'
47+
- '__iOS_13'
48+
- '__iOS_12'
49+
- '__iOS_11'
50+
- '__iOS_10'
51+
- '__iOS_9'
52+
- '__iOS_8'
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
56+
57+
- name: Use Node.js ${{ env.NODE_VERSION }}
58+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
59+
with:
60+
node-version: ${{ env.NODE_VERSION }}
61+
62+
- name: Cache
63+
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
64+
with:
65+
path: ~/.npm
66+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
67+
restore-keys: |
68+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
69+
70+
- name: Install dependencies
71+
run: npm install
72+
73+
- name: Build
74+
run: npm run build
75+
76+
- name: Test
77+
run: |
78+
npm run test:unit -- \
79+
-v --browserstack "${{ matrix.BROWSER }}" \
80+
--jquery-migrate dev --jquery-migrate min \
81+
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min \
82+
--jquery 3.7.1 --jquery 3.7.1.slim --jquery 3.6.4 --jquery 3.6.4.slim \
83+
--jquery 3.5.1 --jquery 3.5.1.slim --jquery 3.4.1 --jquery 3.4.1.slim \
84+
--jquery 3.3.1 --jquery 3.3.1.slim --jquery 3.2.1 --jquery 3.2.1.slim \
85+
--jquery 3.1.1 --jquery 3.1.1.slim --jquery 3.0.0 --jquery 3.0.0.slim \
86+
--run-id ${{ github.run_id }} \
87+
--retries 3 --hard-retries 1
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Browserstack (Core git)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
environment: browserstack
12+
env:
13+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
14+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
15+
NODE_VERSION: 20.x
16+
name: ${{ matrix.BROWSER }}
17+
concurrency:
18+
group: ${{ matrix.BROWSER }}
19+
timeout-minutes: 30
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
BROWSER:
24+
- 'IE_11'
25+
- 'Safari_latest'
26+
- 'Safari_latest-1'
27+
- 'Chrome_latest'
28+
- 'Chrome_latest-1'
29+
- 'Opera_latest'
30+
- 'Edge_latest'
31+
- 'Edge_latest-1'
32+
- 'Firefox_latest'
33+
- 'Firefox_latest-1'
34+
- 'Firefox_115'
35+
- '__iOS_17'
36+
- '__iOS_16'
37+
- '__iOS_15'
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
41+
42+
- name: Use Node.js ${{ env.NODE_VERSION }}
43+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
44+
with:
45+
node-version: ${{ env.NODE_VERSION }}
46+
47+
- name: Cache
48+
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
49+
with:
50+
path: ~/.npm
51+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
52+
restore-keys: |
53+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
54+
55+
- name: Install dependencies
56+
run: npm install
57+
58+
- name: Build
59+
run: npm run build
60+
61+
- name: Test
62+
run: |
63+
npm run test:unit -- \
64+
-v --browserstack "${{ matrix.BROWSER }}" \
65+
--jquery-migrate dev --jquery-migrate min \
66+
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min \
67+
--run-id ${{ github.run_id }} \
68+
--retries 3 --hard-retries 1

.github/workflows/filestash.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Filestash
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read # to fetch code (actions/checkout)
10+
11+
jobs:
12+
update:
13+
runs-on: ubuntu-latest
14+
environment: filestash
15+
env:
16+
NODE_VERSION: 20.x
17+
name: Update Filestash
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21+
22+
- name: Use Node.js ${{ env.NODE_VERSION }}
23+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
24+
with:
25+
node-version: ${{ env.NODE_VERSION }}
26+
27+
- name: Cache
28+
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
29+
with:
30+
path: ~/.npm
31+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Build
39+
run: npm run build
40+
41+
- name: Set up SSH
42+
run: |
43+
install --directory ~/.ssh --mode 700
44+
base64 --decode <<< "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
45+
chmod 600 ~/.ssh/id_ed25519
46+
ssh-keyscan -t ed25519 -H "${{ secrets.FILESTASH_SERVER }}" >> ~/.ssh/known_hosts
47+
48+
- name: Upload to Filestash
49+
run: |
50+
rsync dist/jquery-migrate.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-migrate-git.js
51+
rsync dist/jquery-migrate.min.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-migrate-git.min.js

.github/workflows/node.js.yml

+66-25
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,78 @@
1-
name: CI
1+
name: Node
22

33
on:
44
pull_request:
55
push:
66
branches-ignore: "dependabot/**"
77

8+
env:
9+
NODE_VERSION: 20.x
10+
811
jobs:
9-
build:
12+
test:
1013
runs-on: ubuntu-latest
14+
name: ${{ matrix.MIGRATE_VERSION }} - jQuery ${{ matrix.JQUERY_VERSION }} (Chrome/Firefox)
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
MIGRATE_VERSION: ["min"]
19+
JQUERY_VERSION: ["git.min", "git.slim.min", "3.x-git.min", "3.x-git.slim.min"]
20+
include:
21+
- MIGRATE_VERSION: "esmodules"
22+
JQUERY_VERSION: "3.x-git.slim.min"
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
26+
27+
- name: Use Node.js ${{ env.NODE_VERSION }}
28+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
29+
with:
30+
node-version: ${{ env.NODE_VERSION }}
31+
32+
- name: Cache
33+
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
34+
with:
35+
path: ~/.npm
36+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
37+
restore-keys: |
38+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
39+
40+
- name: Install dependencies
41+
run: npm install
42+
43+
- name: Run tests
44+
run: npm run test:browser -- --jquery-migrate=${{ matrix.MIGRATE_VERSION }} --jquery=${{ matrix.JQUERY_VERSION }}
45+
46+
safari:
47+
runs-on: macos-latest
48+
name: ${{ matrix.MIGRATE_VERSION }} - jQuery ${{ matrix.JQUERY_VERSION }} (Safari)
1149
strategy:
1250
fail-fast: false
1351
matrix:
14-
# Node.js 10 is required by jQuery infra
15-
NODE_VERSION: [10.x, 18.x]
52+
MIGRATE_VERSION: ["min"]
53+
JQUERY_VERSION: ["git.min", "git.slim.min", "3.x-git.min", "3.x-git.slim.min"]
1654
steps:
17-
- name: Checkout
18-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
19-
20-
- name: Cache
21-
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
22-
with:
23-
path: ~/.npm
24-
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
25-
restore-keys: |
26-
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
27-
28-
- name: Use Node.js ${{ matrix.NODE_VERSION }}
29-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
30-
with:
31-
node-version: ${{ matrix.NODE_VERSION }}
32-
33-
- name: Install npm dependencies
34-
run: npm install
35-
36-
- name: Run test
37-
run: npm run ci
55+
- name: Checkout
56+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
57+
58+
- name: Use Node.js ${{ env.NODE_VERSION }}
59+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
60+
with:
61+
node-version: ${{ env.NODE_VERSION }}
62+
63+
- name: Cache
64+
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
65+
with:
66+
path: ~/.npm
67+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
68+
restore-keys: |
69+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
70+
71+
- name: Install dependencies
72+
run: npm install
73+
74+
- name: Run tests
75+
run: |
76+
npm run test:safari -- \
77+
--jquery-migrate=${{ matrix.MIGRATE_VERSION }} \
78+
--jquery=${{ matrix.JQUERY_VERSION }}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ CDN
1515

1616
/external
1717
/node_modules
18+
19+
# Ignore BrowserStack files
20+
local.log
21+
browserstack.err

0 commit comments

Comments
 (0)