-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (69 loc) · 2.16 KB
/
template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Generate google ads api
on:
workflow_call:
inputs:
node-version:
description: 'The node version to use'
required: true
type: string
google-ads-api-version:
description: 'The google ads api version to use'
required: true
type: string
test:
description: 'Whether to test'
required: false
type: boolean
default: false
build:
description: 'Whether to build the bundle'
required: false
type: boolean
default: false
import-suffix:
description: 'ts-proto will emit file imports using the specified suffix'
required: false
type: string
default: ''
jobs:
generate:
name: Generate google ads api ${{ inputs.google-ads-api-version }} for Node ${{ inputs.node-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install protobuf-compiler
run: |
sudo apt-get update -y
sudo apt-get install protobuf-compiler -y
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --prefer-offline
- name: Generate google ads api from protos
run: yarn generate ${{ inputs.google-ads-api-version }} ${{ inputs.import-suffix }}
- name: Test
if: ${{ inputs.test }}
run: yarn test --coverage
- name: Write COVERALLS_TOKEN to .coveralls.yml
if: ${{ inputs.test }}
run: |
echo repo_token: ${{ secrets.COVERALLS_TOKEN }} > .coveralls.yml
- name: Coveralls
if: ${{ inputs.test }}
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: node-${{ inputs.node-version }}
parallel: true
- name: Build
if: ${{ inputs.build }}
run: yarn build
- name: Create build artifact
if: ${{ inputs.build }}
uses: actions/upload-artifact@v4
with:
name: build ${{ inputs.node-version }}
path: dist