Skip to content

upstream

upstream #19421

Workflow file for this run

name: upstream
on:
workflow_dispatch:
inputs:
upstream-sha:
description: "Upstream commit SHA"
required: true
api-branch:
description: "API Branch"
required: true
default: "master"
db-branch:
description: "Not used, left for backward compatibility"
required: false
default: "master"
py-req:
description: "Whether to upgrade python requirements"
required: false
default: "no"
upstream-base-ref:
description: "Upstream base branch (e.g. 'master' or 'release/8.57.0')"
required: false
pr-id:
description: The number of the pull request
required: false
jobs:
acc-tests:
runs-on: ubuntu-latest
name: acc-tests
concurrency:
group: ${{ github.workflow }}-${{ inputs.pr-id }}
cancel-in-progress: true
env:
SCALR_TOKEN: ${{ secrets.SCALR_TOKEN }}
API_BRANCH: ${{ github.event.inputs.api-branch }}
PY_REQ: ${{ github.event.inputs.py-req }}
UPSTREAM_ID: ${{ github.run_number }}
UPSTREAM_BASE_REF: ${{ github.event.inputs.upstream-base-ref }}
steps:
- name: Sudo GitHub Token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{vars.SUDO_GHA_APP_ID}}
installation_id: ${{vars.SUDO_GHA_APP_INSTALLATION_ID}}
private_key: ${{secrets.SUDO_GHA_APP_PRIVATE_KEY}}
- uses: actions/checkout@v4
- name: Notify Upstream about Pending
run: make notify-upstream org_admin_token=${{steps.generate_token.outputs.token}} upstream_sha=${{ github.event.inputs.upstream-sha }} state=pending run_id=${{ github.run_id }}
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Clone Fatmouse Repo
uses: actions/checkout@v4
with:
repository: Scalr/fatmouse
path: fatmouse
ref: ${{ env.API_BRANCH }}
token: ${{steps.generate_token.outputs.token}}
- name: Get Pull Request Labels
id: pr-labels
if: ${{ inputs.pr-id != '' }}
uses: ./fatmouse/.github/actions/pr-labels
with:
github_token: ${{steps.generate_token.outputs.token}}
owner: Scalr
repo: fatmouse
pr_id: ${{ inputs.pr-id }}
- name: Set py-req on PR with Label
if: ${{ inputs.pr-id != '' && contains(steps.pr-labels.outputs.labels, ' py-req ') }}
run: echo "PY_REQ=yes" >> $GITHUB_ENV
- uses: ./fatmouse/.github/actions/preview-env
name: Create preview environment
id: create-preview-env
with:
ref: ${{ env.API_BRANCH }}
github_token: ${{ steps.generate_token.outputs.token }}
google_cloud_credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
run_prefix: e2e-provider-upstream
deployment_type: saas
prepare_runner: true
wait_for_env: true
no_segment: true
agent_pool_id: ${{ !contains(steps.pr-labels.outputs.labels, ' e2e:tev2_on_server ') && vars.TACO_APOOL_ID || '' }}
working_directory: fatmouse
secrets_bucket: tacobell-secrets
- name: Get Scalr Hostname
run: |
SCALR_HOST=${{ steps.create-preview-env.outputs.host }}
echo "SCALR_HOSTNAME=mainiacp.${SCALR_HOST/https:\/\//}" >> $GITHUB_ENV
- name: Run acceptance tests
env:
SCALR_HOSTNAME: ${{ env.SCALR_HOSTNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_AWS_ACCESS_KEY: ${{ secrets.TEST_AWS_ACCESS_KEY }}
TEST_AWS_SECRET_KEY: ${{ secrets.TEST_AWS_SECRET_KEY }}
TEST_AWS_ROLE_ARN: ${{ secrets.TEST_AWS_ROLE_ARN }}
TEST_AWS_EXTERNAL_ID: ${{ secrets.TEST_AWS_EXTERNAL_ID }}
TEST_ARM_CLIENT_ID: ${{ secrets.TEST_ARM_CLIENT_ID }}
TEST_ARM_CLIENT_SECRET: ${{ secrets.TEST_ARM_CLIENT_SECRET }}
TEST_ARM_TENANT_ID: ${{ secrets.TEST_ARM_TENANT_ID }}
TEST_ARM_SUBSCRIPTION_ID: ${{ secrets.TEST_ARM_SUBSCRIPTION_ID }}
run: make testacc
- name: Delete Container
id: delete
working-directory: fatmouse
if: ${{ always() }}
run: |
python -u clickfile.py te rm --no-wait ${{ steps.create-preview-env.outputs.env_name }}
- name: Notify Upstream about Success
if: ${{ success() }}
run: make notify-upstream org_admin_token=${{steps.generate_token.outputs.token}} upstream_sha=${{ github.event.inputs.upstream-sha }} state=success run_id=${{ github.run_id }}
- name: Notify Upstream about Failure
if: ${{ failure() }}
run: make notify-upstream org_admin_token=${{steps.generate_token.outputs.token}} upstream_sha=${{ github.event.inputs.upstream-sha }} state=failure run_id=${{ github.run_id }}