Skip to content
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

chore: Synced file(s) with googlemaps/.github #589

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 3 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/ban-types": [
1,
{ "extendDefaults": true, "types": { "Function": false } }
],
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/ban-types": 1,
"@typescript-eslint/no-empty-function": 1,
"@typescript-eslint/member-ordering": 1,
"@typescript-eslint/explicit-member-accessibility": [
1,
{
Expand Down
52 changes: 45 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.

## Runs CodeQL analysis for all PRs, merges into main and daily.

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: "0 13 * * *"
Expand All @@ -33,15 +43,43 @@ jobs:
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning and analyze
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v1
with:
languages: javascript-typescript
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v1
11 changes: 3 additions & 8 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

## Automatically approves and merges dependabot PRs if tests pass.

name: Dependabot
on: pull_request

Expand All @@ -23,18 +21,15 @@ permissions:
jobs:
test:
uses: ./.github/workflows/test.yml

dependabot:
needs: test
if: ${{ github.actor == 'dependabot[bot]' }}

runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.SYNCED_GITHUB_TOKEN_REPO}}
steps:
- name: Approve
- name: approve
run: gh pr review --approve "$PR_URL"

- name: Merge
- name: merge
run: gh pr merge --auto --squash --delete-branch "$PR_URL"
32 changes: 12 additions & 20 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.

## Builds the documentation website and deploys it to the gh-pages
## branch for pushes to the main branch.

name: Docs
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
node-version: 20
cache: npm

- name: Build Documentation
run: |
npm ci
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: |
npm i
npm run docs

- if: github.ref == 'refs/heads/main'
name: Deploy to gh-pages Branch
uses: peaceiris/actions-gh-pages@v3
- uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
user_name: "googlemaps-bot"
user_email: "[email protected]"
user_name: 'googlemaps-bot'
user_email: '[email protected]'
commit_message: ${{ github.event.head_commit.message }}
30 changes: 30 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Package
on:
- push
- pull_request
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm i
- uses: jpoehnelt/verify-npm-files-action@main
with:
keys: |
types
main
module
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release
on:
push:
branches:
- main
concurrency: release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Test
run: |
npm i
npm run lint
npm test
- name: Release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/commit-analyzer
semantic-release-interval
@semantic-release/release-notes-generator
@semantic-release/git
@semantic-release/github
@semantic-release/npm
@googlemaps/semantic-release-config
semantic-release-npm-deprecate
env:
GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
NPM_TOKEN: ${{ secrets.NPM_WOMBAT_TOKEN }}
33 changes: 11 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

## Runs the eslint and jest unit tests for every PR and push.

name: Test
on: [push, pull_request, workflow_call]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
node-version: 20
cache: npm

- name: Install Dependencies
run: npm ci

- name: Run eslint
run: npm run lint

- name: Run Unit Tests
run: npm test

- name: Run codecov Analysis
uses: codecov/codecov-action@v1
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm i
- run: npm run lint
- run: npm test
- uses: codecov/codecov-action@v1
Loading