Skip to content
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
50 changes: 50 additions & 0 deletions .github/actions/npm-install-build-and-cache/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: NPM Install, Build, and Cache
description: NPM Install Dependencies, NPM Run Build, and Cache Dependencies & Artifacts

outputs:
npm-deps-cache-hit:
description: "Whether or not the npm dependencies are cached"
value: ${{ steps.cache-npm-deps.outputs.cache-hit }}

runs:
using: "composite"
steps:
- name: Set up nodejs
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm

# Set NX_REJECT_UNKNOWN_LOCAL_CACHE=0 to allow NX to use the local cache even if the cache was built by a different machine
# https://nx.dev/recipes/troubleshooting/unknown-local-cache
- name: Allow NX to use unknown local cache
shell: bash
run: echo "NX_REJECT_UNKNOWN_LOCAL_CACHE=0" >> $GITHUB_ENV

- name: Cache NPM dependencies
uses: actions/cache@v3
id: cache-npm-deps
with:
path: |
node_modules
~/.cache
key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.cache-npm-deps.outputs.cache-hit != 'true'
shell: bash
run: npm ci

- name: Build
shell: bash
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
packages/**/build/*
e2e-tests/build/*
if-no-files-found: error
25 changes: 25 additions & 0 deletions .github/actions/retrieve-deps-and-build/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Retrieve Dependencies and Build Artifacts
description: Retrieve cached NPM Install Dependencies and NPM Run Build Artifacts

runs:
using: "composite"
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts

- name: Set up nodejs
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm

- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache
key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }}
73 changes: 73 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Main

on:
push:
branches: [ main ]

permissions:
id-token: write
contents: write
pull-requests: write
checks: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false

- name: "NPM Install, Build, and Cache"
id: npm-install-build-and-cache
uses: ./.github/actions/npm-install-build-and-cache

test:
name: Test
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false

- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build

- name: Test
run: npm run test

lint:
name: Lint
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false

- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build

- name: Lint
run: npm run lint

summary:
name: Summary
needs: [build, test, lint]
runs-on: ubuntu-latest
steps:
- name: Summary
run: |
echo "Build: ${{ needs.build.result }}"
echo "Test: ${{ needs.test.result }}"
echo "Lint: ${{ needs.lint.result }}"
73 changes: 73 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: PR

on:
pull_request:
branches: [ main ]

permissions:
id-token: write
contents: write
pull-requests: write
checks: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false

- name: "NPM Install, Build, and Cache"
id: npm-install-build-and-cache
uses: ./.github/actions/npm-install-build-and-cache

test:
name: Test
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false

- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build

- name: Test
run: npm run test-all

lint:
name: Lint
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false

- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build

- name: Lint
run: npm run lint-all

summary:
name: Summary
needs: [build, test, lint]
runs-on: ubuntu-latest
steps:
- name: Summary
run: |
echo "Build: ${{ needs.build.result }}"
echo "Test: ${{ needs.test.result }}"
echo "Lint: ${{ needs.lint.result }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ lib/
bazel-*
protoc/
.ijwb/
coverage/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.16.0
v20.11.0
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
approvers:
- MarcusLongmuir
- easyCZ
- moadz
labels:
- do-not-merge/hold
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)
[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)
[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)
[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
Expand All @@ -11,7 +10,7 @@ This repository contains a [protoc](https://github.com/google/protobuf) plugin t
(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can
also output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).

This plugin is tested and written using TypeScript 2.7.
This plugin is tested and written using TypeScript 5.3.

## Installation

Expand Down

This file was deleted.

This file was deleted.

41 changes: 0 additions & 41 deletions examples/generated-grpc-node/proto/examplecom/annotations_pb.d.ts

This file was deleted.

Loading