Skip to content

Commit ed997bc

Browse files
committed
feat: Adds a new release workflow; tweaks test workflow; adds dependabot workflow; adds new script to copy /dist to a bucket; deletes superfluous test workflow."
1 parent 0740b3d commit ed997bc

File tree

8 files changed

+403
-168
lines changed

8 files changed

+403
-168
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Dependabot
16+
on: pull_request
17+
18+
permissions:
19+
contents: write
20+
21+
jobs:
22+
dependabot:
23+
runs-on: ubuntu-latest
24+
if: ${{ github.actor == 'dependabot[bot]' }}
25+
env:
26+
PR_URL: ${{ github.event.pull_request.html_url }}
27+
GITHUB_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
28+
steps:
29+
- name: approve
30+
run: gh pr review --approve "$PR_URL"
31+
- name: merge
32+
run: gh pr merge --auto --squash --delete-branch "$PR_URL"
33+

.github/workflows/e2e.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: e2e
16+
on:
17+
pull_request:
18+
branches:
19+
- main
20+
pull_request_review:
21+
types: [submitted]
22+
push:
23+
branches:
24+
- main
25+
schedule:
26+
- cron: "0 12 * * *"
27+
concurrency:
28+
group: e2e-${{ github.ref }}
29+
cancel-in-progress: true
30+
jobs:
31+
build:
32+
if: >-
33+
github.event_name == 'schedule' ||
34+
(github.event_name == 'push' &&
35+
!contains(github.event.head_commit.message, 'chore: update dist folder')) ||
36+
(github.event_name == 'pull_request_review' &&
37+
github.event.review.state == 'approved')
38+
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
shard: [1, 2, 3, 4, 5, 6, 7, 8]
42+
fail-fast: false
43+
steps:
44+
- uses: actions/checkout@v2
45+
with:
46+
lfs: true
47+
- uses: actions/cache@v2
48+
with:
49+
path: ~/.npm
50+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
51+
restore-keys: |
52+
${{ runner.os }}-node
53+
- uses: actions/cache@v2
54+
with:
55+
path: ~/.cache/ms-playwright
56+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-e2e
57+
restore-keys: |
58+
${{ runner.os }}-node-e2e
59+
- run: npm ci
60+
env:
61+
# https://playwright.dev/docs/installation/#skip-browser-downloads
62+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
63+
- run: npm run build
64+
- run: npx playwright install-deps
65+
- run: npx playwright install
66+
- run: npx playwright test -- --shard=${{matrix.shard}}/8
67+
env:
68+
CI: true
69+
- name: Push test report to artifacts
70+
uses: actions/upload-artifact@v4
71+
if: failure()
72+
with:
73+
name: Test Results
74+
path: test-results/

.github/workflows/playwright.yml

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,49 @@
1-
name: Playwright Tests
1+
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Test
217
on:
318
push:
419
branches: [ main ]
520
pull_request:
621
branches: [ main ]
22+
types: [opened]
23+
concurrency:
24+
group: test-${{ github.ref }}
25+
cancel-in-progress: true
726
jobs:
827
test:
9-
timeout-minutes: 60
28+
if: github.event.pull_request.merged == false
1029
runs-on: ubuntu-latest
1130
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
14-
with:
15-
node-version: lts/*
16-
- name: Install dependencies
17-
run: npm ci
18-
- name: Install Playwright Browsers
19-
run: npx playwright install --with-deps
20-
- name: Run Playwright tests
21-
run: npx playwright test
22-
- uses: actions/upload-artifact@v4
23-
if: ${{ !cancelled() }}
24-
with:
25-
name: playwright-report
26-
path: playwright-report/
27-
retention-days: 30
31+
- uses: actions/checkout@v4
32+
if: github.actor != 'dependabot[bot]'
33+
- uses: actions/checkout@v4
34+
if: github.actor == 'dependabot[bot]'
35+
- uses: actions/cache@v4
36+
with:
37+
path: ~/.npm
38+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
39+
restore-keys: |
40+
${{ runner.os }}-node
41+
- uses: actions/cache@v4 # Cache Playwright browsers
42+
with:
43+
path: ~/.cache/ms-playwright
44+
key: ${{ runner.os }}-playwright-${{ hashFiles('playwright.config.ts', 'package.json') }} # Cache key based on config files
45+
restore-keys: |
46+
${{ runner.os }}-playwright-
47+
- run: npm i
48+
- run: npx playwright install
49+
- run: npx playwright test

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Release
16+
on:
17+
push:
18+
branches:
19+
- main
20+
- next
21+
jobs:
22+
release:
23+
if: '!contains(github.event.head_commit.message, "skip ci")'
24+
runs-on: ubuntu-latest
25+
env:
26+
GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}"
27+
steps:
28+
- uses: actions/checkout@v3
29+
with:
30+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
31+
- uses: actions/cache@v3
32+
with:
33+
path: ~/.npm
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node
37+
- uses: actions/setup-node@v3
38+
with:
39+
node-version: '20' # Set to an LTS version of Node
40+
- run: npm i
41+
- run: npm run build
42+
- name: Update dist
43+
run: |
44+
npm run build
45+
git config --global user.name 'googlemaps-bot'
46+
git config --global user.email '[email protected]'
47+
git add dist
48+
git commit -m "chore: update dist folder [skip ci]" || true
49+
git push origin
50+
- name: Semantic Release
51+
uses: cycjimmy/[email protected]
52+
with:
53+
extra_plugins: |
54+
"@semantic-release/[email protected]"
55+
"@semantic-release/[email protected]"
56+
"@semantic-release/[email protected]"
57+
"@semantic-release/[email protected]"
58+
"@semantic-release/[email protected]"
59+
env:
60+
GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
61+
NPM_TOKEN: ${{ secrets.NPM_WOMBAT_TOKEN }} # TODO: Get a hold of NPM_WOMBAT_TOKEN.
62+
- name: Upload to Cloud Bucket
63+
run: |
64+
bash ./upload-to-bucket.sh
65+
env:
66+
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_CREDENTIALS }}

.github/workflows/test.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)