Skip to content

Commit 5be2952

Browse files
authored
Clean up unit and integration tests, remove labeler (#305)
This also removes references to the "credentials" input which is no longer used.
1 parent a5b77a3 commit 5be2952

7 files changed

Lines changed: 424 additions & 414 deletions

File tree

.github/workflows/integration.yml

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'integration'
1+
name: 'Integration'
22

33
on:
44
push:
@@ -13,47 +13,15 @@ concurrency:
1313
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: 'read'
18+
id-token: 'write'
19+
1620
jobs:
17-
auth_json:
21+
integration:
1822
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
19-
name: 'auth_json'
2023
runs-on: 'ubuntu-latest'
21-
steps:
22-
- uses: 'actions/checkout@v3'
23-
24-
- uses: 'actions/setup-node@v3'
25-
with:
26-
node-version: '16.x'
2724

28-
- name: 'npm build'
29-
run: 'npm ci && npm run build'
30-
31-
- uses: 'google-github-actions/auth@main'
32-
with:
33-
credentials_json: '${{ secrets.UPLOAD_CLOUD_STORAGE_GCP_SA_KEY_JSON }}'
34-
35-
- name: 'Create files'
36-
run: |-
37-
mkdir -p test
38-
touch test/test2.txt
39-
40-
- id: 'upload'
41-
name: 'Upload files'
42-
uses: './'
43-
with:
44-
path: './test/test2.txt'
45-
destination: '${{ secrets.UPLOAD_CLOUD_STORAGE_TEST_BUCKET }}/testprefix'
46-
47-
- name: 'Get output'
48-
run: 'echo "${{ steps.upload.outputs.uploaded }}"'
49-
50-
auth_workload_identity_federation:
51-
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
52-
name: 'auth_workload_identity_federation'
53-
permissions:
54-
contents: 'read'
55-
id-token: 'write'
56-
runs-on: 'ubuntu-latest'
5725
steps:
5826
- uses: 'actions/checkout@v3'
5927

.github/workflows/label.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/unit.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'unit'
1+
name: 'Unit'
22

33
on:
44
push:
@@ -15,7 +15,6 @@ concurrency:
1515

1616
jobs:
1717
unit:
18-
name: 'unit'
1918
runs-on: '${{ matrix.os }}'
2019

2120
permissions:

README.md

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,16 @@
1-
<!--
2-
Copyright 2020 Google LLC
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
-->
16-
171
# upload-cloud-storage
182

19-
This action uploads files/folders to a [Google Cloud Storage (GCS)][gcs] bucket. This is useful when
20-
you want upload build artifacts from your workflow.
3+
The `upload-cloud-storage` GitHub Action uploads files to a [Google Cloud
4+
Storage (GCS)][gcs] bucket.
215

22-
Paths to files that are successfully uploaded are set as output variables and can be
23-
used in subsequent steps.
6+
Paths to files that are successfully uploaded are set as output variables and
7+
can be used in subsequent steps.
248

259
## Prerequisites
2610

2711
- This action requires Google Cloud credentials that are authorized to upload
28-
blobs to the specified bucket. See the Authorization section below for more
29-
information.
12+
blobs to the specified bucket. See the [Authorization](#authorization)
13+
section below for more information.
3014

3115
- This action runs using Node 16. If you are using self-hosted GitHub Actions
3216
runners, you must use runner version [2.285.0](https://github.com/actions/virtual-environments)
@@ -295,8 +279,7 @@ If `parent` is set to `false`, it wil be uploaded to `gs://bucket-name/folder2/f
295279
```
296280

297281
- `project_id` - (Optional) Google Cloud project ID to use for billing and API
298-
requests. By default, this is extracted from the credentials or the running
299-
environment.
282+
requests. By default, this is extracted from the running environment.
300283

301284
```yaml
302285
project_id: 'my-project'
@@ -332,11 +315,9 @@ permissions to access the secrets being requested.
332315

333316
### Via google-github-actions/auth
334317

335-
Use [google-github-actions/auth](https://github.com/google-github-actions/auth) to authenticate the action. You can use [Workload Identity Federation][wif] or traditional [Service Account Key JSON][sa] authentication by specifying the `credentials` input. This Action supports both the recommended [Workload Identity Federation][wif] based authentication and the traditional [Service Account Key JSON][sa] based auth.
336-
337-
See [usage](https://github.com/google-github-actions/auth#usage) for more details.
338-
339-
#### Authenticating via Workload Identity Federation
318+
Use [google-github-actions/auth](https://github.com/google-github-actions/auth)
319+
to authenticate the action. You can use [Workload Identity Federation][wif] or
320+
traditional [Service Account Key JSON][sa] authentication.
340321

341322
```yaml
342323
jobs:
@@ -355,20 +336,6 @@ jobs:
355336
- uses: 'google-github-actions/upload-cloud-storage@v1'
356337
```
357338

358-
#### Authenticating via Service Account Key JSON
359-
360-
```yaml
361-
jobs:
362-
job_id:
363-
steps:
364-
- id: 'auth'
365-
uses: 'google-github-actions/auth@v1'
366-
with:
367-
credentials_json: '${{ secrets.gcp_credentials }}'
368-
369-
- uses: 'google-github-actions/upload-cloud-storage@v1'
370-
```
371-
372339
### Via Application Default Credentials
373340

374341
If you are hosting your own runners, **and** those runners are on Google Cloud,
@@ -389,4 +356,4 @@ Credentials.
389356

390357
[gcs]: https://cloud.google.com/storage
391358
[wif]: https://cloud.google.com/iam/docs/workload-identity-federation
392-
[sa]: https://cloud.google.com/iam/docs/creating-managing-service-accounts
359+
[sa]: https://cloud.google.com/iam/docs/creating-managing-service-accounts

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
project_id:
77
description: |-
88
Project ID to use for making requests. By default, this is extracted from
9-
the credentials or the running environment.
9+
the running environment.
1010
required: false
1111
path:
1212
description: |-

0 commit comments

Comments
 (0)