Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(action): build as an javascript action (#331)
This switches the GitHub action to be a javascript action (from Docker). This is orders of magnitude faster to run -- no more docker build (or download) on every invocation. The downside is that we must compile the dist file before each release. This is accomplished via a new workflow that runs on pushes to main that will open a new PR if there are changes to the dist output. Fixes #141
- Loading branch information
Showing
22 changed files
with
22,371 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ build/ | |
docs/ | ||
protos/ | ||
samples/generated/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2022 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. | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
name: build-action | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build | ||
run: |- | ||
set -e | ||
npm i | ||
npm run compile | ||
pushd action | ||
npm ci | ||
npm run package | ||
- name: googleapis/code-suggester@v2 | ||
env: | ||
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} | ||
with: | ||
command: pr | ||
upstream_owner: googleapis | ||
upstream_repo: code-suggester | ||
description: 'Compiles the code-suggester action dist' | ||
title: 'build(action): build dist' | ||
message: 'build(action): build dist' | ||
branch: build-dist | ||
primary: main | ||
fork: true | ||
force: true | ||
git_dir: './action/dist' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
name: ci-action | ||
jobs: | ||
test-action: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- run: |- | ||
set -e | ||
npm i | ||
npm run compile | ||
pushd action | ||
npm ci | ||
npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ test/fixtures | |
build/ | ||
docs/ | ||
protos/ | ||
dist/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
**/node_modules | ||
**/coverage | ||
test/fixtures | ||
build/ | ||
docs/ | ||
protos/ | ||
samples/generated/ | ||
dist/ |
Oops, something went wrong.