Skip to content

Commit

Permalink
SCALRCORE-24559: Move downstream provider tests to TEv2
Browse files Browse the repository at this point in the history
  • Loading branch information
vyahello committed Dec 13, 2022
1 parent 08e0437 commit 1503960
Showing 1 changed file with 76 additions and 32 deletions.
108 changes: 76 additions & 32 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,83 @@ jobs:
DB_BRANCH: ${{ github.event.inputs.db-branch }}
PY_REQ: ${{ github.event.inputs.py-req }}
UPSTREAM_ID: ${{ github.run_number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
# - uses: actions/setup-go@v3
# with:
# go-version: "1.17"
- name: Clone fatmouse repo
uses: actions/checkout@v3
with:
go-version: "1.17"
- name: Create container
id: create
uses: Scalr/gh-action-revizor@master
repository: Scalr/fatmouse
path: provider
- id: auth
uses: google-github-actions/auth@v0
with:
command: create
- name: Run acceptance tests
env:
SCALR_HOSTNAME: ${{ steps.create.outputs.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
if: ${{ always() && steps.create.outputs.container_id }}
uses: Scalr/gh-action-revizor@master
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
- name: Copy secrets
shell: bash
run: |
echo "::group::Copy secrets"
mkdir ~/.scalr-labs
gsutil cp gs://drone_bucket/prod/private.d/.secrets.yaml tacobell/.secrets.yaml
gsutil cp gs://drone_bucket/prod/private.d/github.json ~/.scalr-labs/github.json
echo "::endgroup::"
- name: Configure docker
shell: bash
run: gcloud auth configure-docker eu.gcr.io
- name: Pull python builder
shell: bash
run: |
echo "::group::Pull python builder image"
docker pull eu.gcr.io/development-156220/fatmouse/python-builder:master
docker tag eu.gcr.io/development-156220/fatmouse/python-builder:master fatmouse/python-builder:master
echo "::endgroup::"
- name: Get current job log URL
uses: Tiryoh/gha-jobid-action@v0
id: get-job-id
with:
command: delete
container_id: ${{ steps.create.outputs.container_id }}
- name: Notify upstream about success
if: ${{ success() }}
run: make notify-upstream 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 upstream_sha=${{ github.event.inputs.upstream-sha }} state=failure run_id=${{ github.run_id }}
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: ${{ github.job }}
- name: Create container
id: create-container
shell: bash
run: docker run --rm -e GITHUB_WORKSPACE=true -w /fatmouse -v $PWD:/fatmouse -v /var/run/docker.sock:/var/run/docker.sock fatmouse/python-builder:master python -u clickfile.py te up --fatmouse-branch master --scalr-branch master --run-url ${{ steps.get-job-id.outputs.html_url }} --dedicated
- name: Delete container
id: delete-container
shell: bash
run: docker run --rm -w /fatmouse -v $PWD:/fatmouse -v /var/run/docker.sock:/var/run/docker.sock -v ~/.scalr-labs:/etc/scalr-labs -v /tmp:/tmp fatmouse/python-builder:master python -u clickfile.py te rm ${{ steps.create-test-app.outputs.container_id }}
# - name: Create container
# id: create
# uses: Scalr/gh-action-revizor@master
# with:
# command: create
# - name: Run acceptance tests
# env:
# SCALR_HOSTNAME: ${{ steps.create.outputs.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
# if: ${{ always() && steps.create.outputs.container_id }}
# uses: Scalr/gh-action-revizor@master
# with:
# command: delete
# container_id: ${{ steps.create.outputs.container_id }}
# - name: Notify upstream about success
# if: ${{ success() }}
# run: make notify-upstream 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 upstream_sha=${{ github.event.inputs.upstream-sha }} state=failure run_id=${{ github.run_id }}

0 comments on commit 1503960

Please sign in to comment.