generated from mchirico/ts
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (66 loc) · 2.61 KB
/
angular.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
81
82
83
84
name: Angular
on:
push:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
if: github.actor == github.event.repository.owner.login
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Setup gcloud CLI
- uses: mchirico/gcp-actions@v1
with:
version: 'latest'
service_account_key: ${{ secrets.OWNER }}
# Configure docker to use the gcloud command-line tool as a credential helper
- run: |
# Set up docker to authenticate
# via gcloud command-line tool.
gcloud auth configure-docker
gcloud components update --quiet
# Credentials
- name: Get and Create Credentials
run: |
mkdir -p credentials
gsutil cp gs://nodesepta/ts-express/credentials/* ./credentials/.
mkdir -p angular/src/environments
gsutil cp gs://nodesepta/ts-express/environments/* ./angular/src/environments/.
- name: Install ChromeDriver
run: |
CHROME_VERSION=$(google-chrome --version | cut -f 3 -d ' ' | cut -d '.' -f 1) \
&& CHROMEDRIVER_RELEASE=$(curl --location --fail --retry 3 http://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}) \
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/chromedriver_linux64.zip "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_RELEASE/chromedriver_linux64.zip" \
&& cd /tmp \
&& unzip chromedriver_linux64.zip \
&& rm -rf chromedriver_linux64.zip \
&& sudo mv chromedriver /usr/local/bin/chromedriver \
&& sudo chmod +x /usr/local/bin/chromedriver \
&& chromedriver --version
# ng command for Angular
- name: ng command for Angular
run: |
npm install -g @angular/cli
# Angular install and test
- name: Angular install and test
run: |
cd angular
npm install
ng lint
npm run test -- --no-watch --code-coverage --no-progress --browsers=ChromeHeadlessCI
npm run coverage
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# BigQuery
- name: Working with BigQuery
run: |
txt="Angular ts-express"
bq query --nouse_legacy_sql 'CREATE TABLE IF NOT EXISTS `septapig.github.log` (msg string, timeEnter timestamp);'
bq query --nouse_legacy_sql --parameter=MSG:STRING:"${txt}" 'insert into `septapig.github.log` (msg,timeEnter) values (@MSG,CURRENT_TIMESTAMP())'