Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 2 additions & 188 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'integration'
name: 'Integration'

on:
push:
Expand All @@ -7,190 +7,15 @@ on:
pull_request:
branches:
- 'main'
workflow_dispatch:

concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
auth_json:
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'

- uses: 'actions/setup-node@v3'
with:
node-version: '16.x'

- name: 'npm build'
run: 'npm ci && npm run build'

- uses: 'google-github-actions/auth@main'
with:
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'

- id: 'deploy'
uses: './'
with:
name: 'auth-json-http-${{ github.run_number }}'
runtime: 'nodejs10'
entry_point: 'helloWorld'
source_dir: './tests/test-node-func/'

# Auth as the main account for integration and cleanup
- uses: 'google-github-actions/auth@main'
with:
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'

- name: 'integration'
env:
URL: '${{ steps.deploy.outputs.url }}'
run: 'npm run e2e-tests'

- name: 'cleanup'
if: ${{ always() }}
env:
CLEANUP_FUNCTION_NAME: '${{ steps.deploy.outputs.id }}'
run: 'npm run cleanup'


auth_workload_identity_federation:
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
name: 'auth_workload_identity_federation'
permissions:
contents: 'read'
id-token: 'write'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'

- uses: 'actions/setup-node@v3'
with:
node-version: '16.x'

- name: 'npm build'
run: 'npm ci && npm run build'

- uses: 'google-github-actions/auth@main'
with:
workload_identity_provider: '${{ secrets.WIF_PROVIDER_NAME }}'
service_account: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'

- id: 'deploy'
uses: './'
with:
name: 'auth-wif-http-${{ github.run_number }}'
runtime: 'nodejs10'
entry_point: 'helloWorld'
source_dir: './tests/test-node-func/'

# Auth as the main account for integration and cleanup
- uses: 'google-github-actions/auth@main'
with:
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'

- name: 'integration'
env:
URL: '${{ steps.deploy.outputs.url }}'
run: 'npm run e2e-tests'

- name: 'cleanup'
if: ${{ always() }}
env:
CLEANUP_FUNCTION_NAME: '${{ steps.deploy.outputs.id }}'
run: 'npm run cleanup'

# Deprecated
auth_setup_gcloud:
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
name: 'auth_setup_gcloud'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'

- uses: 'actions/setup-node@v3'
with:
node-version: '16.x'

- name: 'npm build'
run: 'npm ci && npm run build'

- uses: 'google-github-actions/setup-gcloud@main'
with:
service_account_email: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'
service_account_key: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
export_default_credentials: true

- id: 'deploy'
uses: ./
with:
name: 'auth-setup-gcloud-${{ github.run_number }}'
runtime: 'nodejs10'
entry_point: 'helloWorld'
source_dir: './tests/test-node-func/'

# Auth as the main account for integration and cleanup
- uses: 'google-github-actions/auth@main'
with:
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'

- name: 'integration'
env:
URL: '${{ steps.deploy.outputs.url }}'
run: 'npm run e2e-tests'

- name: 'cleanup'
if: ${{ always() }}
env:
CLEANUP_FUNCTION_NAME: '${{ steps.deploy.outputs.id }}'
run: 'npm run cleanup'

# Deprecated
auth_builtin_credentials:
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
name: 'auth_builtin_credentials'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'

- uses: 'actions/setup-node@v3'
with:
node-version: '16.x'

- name: 'npm build'
run: 'npm ci && npm run build'

- id: 'deploy'
uses: './'
with:
credentials: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
name: 'auth-builtin-${{ github.run_number }}'
region: 'us-east1'
runtime: 'nodejs10'
entry_point: 'helloWorld'
memory_mb: 512
source_dir: './tests/test-node-func/'

# Auth as the main account for integration and cleanup
- uses: 'google-github-actions/auth@main'
with:
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'

- name: 'integration'
env:
URL: '${{ steps.deploy.outputs.url }}'
run: 'npm run e2e-tests'

- name: 'cleanup'
if: ${{ always() }}
env:
CLEANUP_FUNCTION_NAME: '${{ steps.deploy.outputs.id }}'
run: 'npm run cleanup'

https_trigger:
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
name: 'https_trigger'
permissions:
contents: 'read'
id-token: 'write'
Expand Down Expand Up @@ -219,11 +44,6 @@ jobs:
source_dir: './tests/test-node-func/'
https_trigger_security_level: 'secure_always'

# Auth as the main account for integration and cleanup
- uses: 'google-github-actions/auth@main'
with:
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'

- name: 'cleanup'
if: ${{ always() }}
env:
Expand All @@ -232,7 +52,6 @@ jobs:

event_trigger:
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
name: 'event_trigger'
permissions:
contents: 'read'
id-token: 'write'
Expand Down Expand Up @@ -273,11 +92,6 @@ jobs:
max_instances: 5
timeout: 300

# Auth as the main account for integration and cleanup
- uses: 'google-github-actions/auth@main'
with:
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'

- name: 'cleanup'
if: ${{ always() }}
env:
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/label.yml

This file was deleted.

16 changes: 12 additions & 4 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'unit'
name: 'Unit'

on:
push:
Expand All @@ -15,15 +15,18 @@ concurrency:

jobs:
unit:
name: 'unit'
runs-on: '${{ matrix.os }}'
permissions:
contents: 'read'
id-token: 'write'

strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
- 'windows-latest'
- 'macos-latest'
runs-on: '${{ matrix.os }}'

steps:
- uses: 'actions/checkout@v3'
Expand All @@ -41,10 +44,15 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
run: 'npm run lint'

- uses: 'google-github-actions/auth@main'
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
with:
workload_identity_provider: '${{ secrets.WIF_PROVIDER_NAME }}'
service_account: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'

- name: 'npm test'
env:
DEPLOY_CF_PROJECT_ID: '${{ secrets.DEPLOY_CF_PROJECT_ID }}'
DEPLOY_CF_SA_EMAIL: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'
DEPLOY_CF_SA_KEY_JSON: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
DEPLOY_CF_SECRET_VERSION_REF: '${{ secrets.DEPLOY_CF_SECRET_VERSION_REF }}'
run: 'npm run test'
Loading