Skip to content

Commit

Permalink
[MAIN-22] fix code review action
Browse files Browse the repository at this point in the history
  • Loading branch information
gioelemella committed Jan 15, 2025
1 parent 4b2b603 commit b478b4d
Showing 1 changed file with 62 additions and 5 deletions.
67 changes: 62 additions & 5 deletions .github/workflows/code_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,65 @@ jobs:

smoke_test:
name: Smoke Test
uses: ./.github/workflows/integration_test.yml
with:
environment: 'local'
notify: false
secrets: inherit
runs-on: ubuntu-latest
environment:
name: dev
steps:
- name: Checkout
id: checkout
uses: actions/checkout@1f9a0c22da41e6ebfa534300ef656657ea2c6707

- name: Login
id: login
# from https://github.com/Azure/login/commits/master
uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION_ID }}

- name: Run Integration Tests
shell: bash
run: |
export SUBKEY=${{ secrets.SUBKEY }}
export CANARY=${{ inputs.canary }}
export CUCUMBER_PUBLISH_TOKEN=${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
export GPD_SUBKEY='${{ secrets.GPD_SUBKEY }}'
cd ./integration-test
chmod +x ./run_integration_test.sh
./run_integration_test.sh ${{( github.event.inputs == null && 'dev') || inputs.environment }}
delete_github_deployments:
runs-on: ubuntu-latest
needs: smoke_test
if: ${{ always() }}
steps:
- name: Delete Previous deployments
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
env:
SHA_HEAD: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha}}
with:
script: |
const { SHA_HEAD } = process.env
const deployments = await github.rest.repos.listDeployments({
owner: context.repo.owner,
repo: context.repo.repo,
sha: SHA_HEAD
});
await Promise.all(
deployments.data.map(async (deployment) => {
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id,
state: 'inactive'
});
return github.rest.repos.deleteDeployment({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id
});
})
);

0 comments on commit b478b4d

Please sign in to comment.