<commit_before>name: deploy-cloud-functions Integration

on: [push, pull_request]

jobs:
  gcloud:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
    name: with setup-gcloud
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: google-github-actions/setup-gcloud@master # Set up ADC for credentials
      with:
        service_account_email: ${{ secrets.DEPLOY_CF_SA_EMAIL }}
        service_account_key: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        export_default_credentials: true
    - id: build
      name: Build dist
      run: |-
        npm install
        npm run build
    - id: deploy
      uses: ./
      with:
        name: cf-http-gcloud-${{ github.run_number }}
        runtime: nodejs10
        entry_point: helloWorld
        source_dir: ./tests/test-node-func/
    - uses: actions/setup-node@master
      with:
        node-version: 12.x
    - run: npm install
    - name: integration tests
      run: npm run e2e-tests
      env:
        URL: ${{ steps.deploy.outputs.url }}
    - name: integration test clean up
      run: npm run cleanup
      env:
        DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-central1/functions/cf-http-gcloud-${{ github.run_number }}

  b64_json:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
    name: with base64 json creds
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - id: build
      name: Build dist
      run: |-
        npm install
        npm run build
    - id: deploy
      uses: ./
      with:
        name: cf-http-b64-${{ github.run_number }}
        runtime: nodejs10
        entry_point: helloWorld
        source_dir: ./tests/test-node-func/
        credentials: ${{ secrets.DEPLOY_CF_SA_KEY_B64 }}
    - uses: actions/setup-node@master
      with:
        node-version: 12.x
    - run: npm install
    - uses: google-github-actions/setup-gcloud@master # Set up ADC to make authenticated request to service
      with:
        service_account_email: ${{ secrets.DEPLOY_CF_SA_EMAIL }}
        service_account_key: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        export_default_credentials: true
    - name: integration tests
      run: npm run e2e-tests
      env:
        URL: ${{ steps.deploy.outputs.url }}
    - name: integration test clean up
      run: npm run cleanup
      env:
        DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-central1/functions/cf-http-b64-${{ github.run_number }}

  json:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
    name: with json creds
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - id: build
      name: Build dist
      run: |-
        npm install
        npm run build
    - id: deploy
      uses: ./
      with:
        name: cf-http-json-${{ github.run_number }}
        region: us-east1
        runtime: nodejs10
        entry_point: helloWorld
        memory_mb: 512
        source_dir: ./tests/test-node-func/
        credentials: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
    - uses: actions/setup-node@master
      with:
        node-version: 12.x
    - run: npm install
    - uses: google-github-actions/setup-gcloud@master # Set up ADC to make authenticated request to service
      with:
        service_account_email: ${{ secrets.DEPLOY_CF_SA_EMAIL }}
        service_account_key: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        export_default_credentials: true
    - name: integration tests
      run: npm run e2e-tests
      env:
        URL: ${{ steps.deploy.outputs.url }}
    - name: integration test clean up
      run: npm run cleanup
      env:
        DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-east1/functions/cf-http-json-${{ github.run_number }}
        CF_REGION: us-east1

  json-event-trigger:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
    name: test event trigger
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - id: build
      name: Build dist
      run: |-
        npm install
        npm run build
    - id: deploy
      uses: ./
      with:
        name: cf-event-json-${{ github.run_number }}
        runtime: nodejs10
        entry_point: helloWorld
        source_dir: ./tests/test-node-func/
        credentials: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        event_trigger_type: providers/cloud.pubsub/eventTypes/topic.publish
        event_trigger_resource: ${{ secrets.DEPLOY_CF_EVENT_PUBSUB_TOPIC }}
        env_vars_file: './tests/env-var-files/test.good.yaml'
    - uses: actions/setup-node@master
      with:
        node-version: 12.x
    - run: npm install
    - uses: google-github-actions/setup-gcloud@master # Set up ADC to make authenticated request to service
      with:
        service_account_email: ${{ secrets.DEPLOY_CF_SA_EMAIL }}
        service_account_key: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        export_default_credentials: true
    - name: integration test clean up
      run: npm run cleanup
      env:
        DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-central1/functions/cf-event-json-${{ github.run_number }}
  b64_json_invalid_src:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
    name: with invalid source dir
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - id: build<commit_msg>chore: add dependabot workflow changes (#77)<commit_after>name: deploy-cloud-functions Integration

on:
  push:
    branches:
    - 'main'
  pull_request:

jobs:
  gcloud:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
    name: with setup-gcloud
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: google-github-actions/setup-gcloud@master # Set up ADC for credentials
      with:
        service_account_email: ${{ secrets.DEPLOY_CF_SA_EMAIL }}
        service_account_key: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        export_default_credentials: true
    - id: build
      name: Build dist
      run: |-
        npm install
        npm run build
    - id: deploy
      uses: ./
      with:
        name: cf-http-gcloud-${{ github.run_number }}
        runtime: nodejs10
        entry_point: helloWorld
        source_dir: ./tests/test-node-func/
    - uses: actions/setup-node@master
      with:
        node-version: 12.x
    - run: npm install
    - name: integration tests
      run: npm run e2e-tests
      env:
        URL: ${{ steps.deploy.outputs.url }}
    - name: integration test clean up
      run: npm run cleanup
      env:
        DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-central1/functions/cf-http-gcloud-${{ github.run_number }}

  b64_json:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
    name: with base64 json creds
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - id: build
      name: Build dist
      run: |-
        npm install
        npm run build
    - id: deploy
      uses: ./
      with:
        name: cf-http-b64-${{ github.run_number }}
        runtime: nodejs10
        entry_point: helloWorld
        source_dir: ./tests/test-node-func/
        credentials: ${{ secrets.DEPLOY_CF_SA_KEY_B64 }}
    - uses: actions/setup-node@master
      with:
        node-version: 12.x
    - run: npm install
    - uses: google-github-actions/setup-gcloud@master # Set up ADC to make authenticated request to service
      with:
        service_account_email: ${{ secrets.DEPLOY_CF_SA_EMAIL }}
        service_account_key: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        export_default_credentials: true
    - name: integration tests
      run: npm run e2e-tests
      env:
        URL: ${{ steps.deploy.outputs.url }}
    - name: integration test clean up
      run: npm run cleanup
      env:
        DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-central1/functions/cf-http-b64-${{ github.run_number }}

  json:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
    name: with json creds
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - id: build
      name: Build dist
      run: |-
        npm install
        npm run build
    - id: deploy
      uses: ./
      with:
        name: cf-http-json-${{ github.run_number }}
        region: us-east1
        runtime: nodejs10
        entry_point: helloWorld
        memory_mb: 512
        source_dir: ./tests/test-node-func/
        credentials: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
    - uses: actions/setup-node@master
      with:
        node-version: 12.x
    - run: npm install
    - uses: google-github-actions/setup-gcloud@master # Set up ADC to make authenticated request to service
      with:
        service_account_email: ${{ secrets.DEPLOY_CF_SA_EMAIL }}
        service_account_key: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        export_default_credentials: true
    - name: integration tests
      run: npm run e2e-tests
      env:
        URL: ${{ steps.deploy.outputs.url }}
    - name: integration test clean up
      run: npm run cleanup
      env:
        DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-east1/functions/cf-http-json-${{ github.run_number }}
        CF_REGION: us-east1

  json-event-trigger:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
    name: test event trigger
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - id: build
      name: Build dist
      run: |-
        npm install
        npm run build
    - id: deploy
      uses: ./
      with:
        name: cf-event-json-${{ github.run_number }}
        runtime: nodejs10
        entry_point: helloWorld
        source_dir: ./tests/test-node-func/
        credentials: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        event_trigger_type: providers/cloud.pubsub/eventTypes/topic.publish
        event_trigger_resource: ${{ secrets.DEPLOY_CF_EVENT_PUBSUB_TOPIC }}
        env_vars_file: './tests/env-var-files/test.good.yaml'
    - uses: actions/setup-node@master
      with:
        node-version: 12.x
    - run: npm install
    - uses: google-github-actions/setup-gcloud@master # Set up ADC to make authenticated request to service
      with:
        service_account_email: ${{ secrets.DEPLOY_CF_SA_EMAIL }}
        service_account_key: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        export_default_credentials: true
    - name: integration test clean up
      run: npm run cleanup
      env:
        DEPLOY_CF_SA_KEY_JSON: ${{ secrets.DEPLOY_CF_SA_KEY_JSON }}
        CF_NAME: projects/${{ secrets.DEPLOY_CF_PROJECT_ID }}/locations/us-central1/functions/cf-event-json-${{ github.run_number }}
  b64_json_invalid_src:
    if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
    name: with invalid source dir
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - id: build
{'fraction_non_alphanumeric': 0.11395774413575112, 'fraction_numerical': 0.007652636832473798, 'mean_word_length': 2.475860075166233, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2471272', 'n_tokens_mistral': 4166, 'n_tokens_neox': 3860, 'n_words': 810}