-
Notifications
You must be signed in to change notification settings - Fork 510
117 lines (109 loc) · 3.43 KB
/
upload-cloud-storage-it.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: upload-cloud-storage Integration
on:
push:
paths:
- 'upload-cloud-storage/**'
- '.github/workflows/upload-cloud-storage*'
jobs:
gcloud:
name: with setup-gcloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: build
name: Build dist
working-directory: upload-cloud-storage
run: |-
npm install
npm run build
- uses: google-github-actions/setup-gcloud@master
with:
service_account_email: ${{ secrets.UPLOAD_CLOUD_STORAGE_GCP_SA_EMAIL }}
service_account_key: ${{ secrets.UPLOAD_CLOUD_STORAGE_GCP_SA_KEY_B64 }}
export_default_credentials: true
- name: make temp folder and file
run: |
mkdir -p test
touch test/test2.txt
- id: upload
name: upload file
uses: ./upload-cloud-storage
with:
path: ./test/test2.txt
destination: ${{ secrets.UPLOAD_CLOUD_STORAGE_TEST_BUCKET }}/testprefix
- name: get output
run: echo '${{ steps.upload.outputs.uploaded }}'
b64_json:
name: with base64 json creds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: build
name: Build dist
working-directory: upload-cloud-storage
run: |-
npm install
npm run build
- name: make temp folder and files
run: |
mkdir -p test
touch test/test1.txt
touch test/test2.txt
- id: upload
name: upload folder
uses: ./upload-cloud-storage
with:
path: ./test
destination: ${{ secrets.UPLOAD_CLOUD_STORAGE_TEST_BUCKET }}/testprefix
credentials: ${{ secrets.UPLOAD_CLOUD_STORAGE_GCP_SA_KEY_B64 }}
- name: get output
run: echo '${{ steps.upload.outputs.uploaded }}'
json:
name: with json creds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: build
name: Build dist
working-directory: upload-cloud-storage
run: |-
npm install
npm run build
- name: make temp folder and files
run: |
mkdir -p test
touch test/test1.txt
touch test/test2.txt
- id: upload
name: upload folder
uses: ./upload-cloud-storage
with:
path: ./test
destination: ${{ secrets.UPLOAD_CLOUD_STORAGE_TEST_BUCKET }}/testprefix
credentials: ${{ secrets.UPLOAD_CLOUD_STORAGE_GCP_SA_KEY_JSON }}
- name: get output
run: echo '${{ steps.upload.outputs.uploaded }}'
mocha-it:
name: mocha integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: google-github-actions/setup-gcloud@master
with:
service_account_email: ${{ secrets.UPLOAD_CLOUD_STORAGE_GCP_SA_EMAIL }}
service_account_key: ${{ secrets.UPLOAD_CLOUD_STORAGE_GCP_SA_KEY_B64 }}
export_default_credentials: true
- uses: actions/setup-node@master
with:
node-version: 12.x
- name: npm install
run: npm install
working-directory: ./upload-cloud-storage
- name: npm lint
run: npm run lint
working-directory: ./upload-cloud-storage
- name: npm test
run: npm run test
working-directory: ./upload-cloud-storage
env:
UPLOAD_CLOUD_STORAGE_TEST_BUCKET: ${{ secrets.UPLOAD_CLOUD_STORAGE_TEST_BUCKET }}