forked from actions-on-google/actions-on-google-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
86 lines (86 loc) · 2.75 KB
/
cloudbuild.yaml
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
81
82
83
84
85
86
steps:
# Fetch entire repo
- name: gcr.io/cloud-builders/git
args: ['fetch', '--unshallow']
id: 'Unshallow git'
# Git Presubmit Linter
- name: 'gcr.io/cloud-builders/git'
args: ['clone', 'https://github.com/google/git-presubmit-linter.git']
id: 'Download Git Presubmit Linter'
waitFor: ['Unshallow git']
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'bash'
args: ['-c', 'git log -1 --pretty=%B | ./git-presubmit-linter/rules/verb-tense.sh imperative']
id: 'Check git message verb tense'
waitFor: ['Download Git Presubmit Linter']
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'bash'
args: ['-c', 'git log -1 --pretty=%B | ./git-presubmit-linter/rules/line-length.sh 80']
id: 'Check git message line length'
waitFor: ['Download Git Presubmit Linter']
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'bash'
args: ['-c', 'git diff HEAD^ --pretty=%B | ./git-presubmit-linter/rules/trailing-whitespace.sh']
id: 'Check commit no trailing whitespace'
waitFor: ['Download Git Presubmit Linter']
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'bash'
args: ['-c', './git-presubmit-linter/tools/changelog.sh > changelog.txt']
id: 'Generate changelog'
waitFor: ['Download Git Presubmit Linter']
# Yarn
- name: 'node:8.15.1'
entrypoint: 'yarn'
args: ['']
id: 'Install dependencies'
waitFor: ['-']
- name: 'node:8.15.1'
entrypoint: 'yarn'
args: ['audit']
id: 'Audit'
waitFor: ['Install dependencies']
- name: 'node:8.15.1'
entrypoint: 'yarn'
args: ['lint']
id: 'Lint'
waitFor: ['Install dependencies']
- name: 'node:8.15.1'
entrypoint: 'yarn'
args: ['build']
id: 'Build'
waitFor: ['Install dependencies']
- name: 'node:8.15.1'
entrypoint: 'bash'
args: ['-c', './node_modules/.bin/nyc ./node_modules/.bin/ava --fail-fast']
id: 'Test'
waitFor: ['Build']
- name: 'node:8.15.1'
entrypoint: 'bash'
args: ['./script/coverage.sh']
id: 'Coverage'
waitFor: ['Test']
- name: 'node:8.15.1'
entrypoint: 'yarn'
args: ['docs']
id: 'Docgen'
waitFor: ['Install dependencies', 'Coverage']
# Upload docs while keeping the same hierarchy
- name: 'gcr.io/cloud-builders/gsutil'
args: ['-m', 'cp', '-r', 'docs/', 'gs://fleker-actions-on-googl-lib/$SHORT_SHA/']
id: 'Store docs'
waitFor: ['Docgen']
# Package library
- name: 'node:8.15.1'
entrypoint: 'yarn'
args: ['pack']
id: 'Generate archive'
waitFor: ['Build', 'Coverage'] # Coverage script will clear out the archive, so we wait til it's done
- name: 'ubuntu'
entrypoint: 'bash'
args: ['-c', 'tar -tf *.tgz | ./git-presubmit-linter/tools/filelist.sh ./script/package.txt']
id: 'Verify archive contents'
waitFor: ['Generate archive']
artifacts:
objects:
location: 'gs://fleker-actions-on-googl-lib/$SHORT_SHA'
paths: ['changelog.txt', 'actions-on-google*.tgz']