diff --git a/.github/workflows/integ-tests.yml b/.github/workflows/integ-tests.yml new file mode 100644 index 000000000..81d422afc --- /dev/null +++ b/.github/workflows/integ-tests.yml @@ -0,0 +1,59 @@ +on: + pull_request_review: + types: [submitted] + +name: Run Integration Tests + +permissions: + id-token: write + contents: read + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GitHubActionsDeployTaskIntegrationTests + role-session-name: deploy_task_integration_tests + aws-region: us-west-2 + + # - name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to false + # uses: ./ + # with: + # task-definition: test-resources/task-definition-run-task.json + # cluster: github-actions-deploy-task-def-integ-test + # run-task: true + # run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64 + # run-task-assign-public-IP: ENABLED + # run-task-security-groups: sg-067ebcde49c0f3ad8 + # run-task-launch-type: FARGATE + # wait-for-task-stopped: false + + # - name: Deploy Amazon ECS task definition with one-off task and wait for task stopped set to true + # uses: ./ + # with: + # task-definition: test-resources/task-definition-run-task.json + # cluster: github-actions-deploy-task-def-integ-test + # run-task: true + # run-task-subnets: subnet-e5604fce, subnet-fe9355b4, subnet-c49431bc, subnet-392f9b64 + # run-task-assign-public-IP: ENABLED + # run-task-security-groups: sg-067ebcde49c0f3ad8 + # run-task-launch-type: FARGATE + # wait-for-task-stopped: true + # enable-ecs-managed-tags: true + + - name: Deploy Amazon ECS task definition with ECS Service + uses: ./ + with: + task-definition: test-resources/task-definition.json + service: github-actions-deploy-task-def-integ-test + cluster: github-actions-deploy-task-def-integ-test + wait-for-service-stability: true + enable-ecs-managed-tags: true \ No newline at end of file diff --git a/.mergify.yml b/.mergify.yml index 787336e67..b6e747632 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -2,6 +2,7 @@ queue_rules: - name: default conditions: # Conditions to get out of the queue (= merged) + - status-success=Run Integration Tests - status-success=Run Unit Tests - status-success=Semantic Pull Request - status-success=Analyze (javascript) @@ -13,6 +14,7 @@ pull_request_rules: - "#approved-reviews-by>=1" - approved-reviews-by=@aws-actions/aws-ecs-devx - -approved-reviews-by~=author + - status-success=Run Integration Tests - status-success=Run Unit Tests - status-success=Semantic Pull Request - status-success=Analyze (javascript) @@ -26,7 +28,7 @@ pull_request_rules: method: squash name: default - - name: Automatically approve and merge Dependabot PRs + - name: Automatically approve Dependabot PRs conditions: - base=master - author=dependabot[bot] @@ -40,6 +42,21 @@ pull_request_rules: actions: review: type: APPROVE + + - name: Automatically merge Dependabot PRs + conditions: + - base=master + - "#approved-reviews-by>=1" + - author=dependabot[bot] + - status-success=Run Integration Tests + - status-success=Run Unit Tests + - status-success=Semantic Pull Request + - status-success=Analyze (javascript) + - -title~=(WIP|wip) + - -label~=(blocked|do-not-merge) + - -merged + - -closed + actions: queue: method: squash - name: default + name: default \ No newline at end of file diff --git a/test-resources/task-definition-run-task.json b/test-resources/task-definition-run-task.json new file mode 100644 index 000000000..20a3e4616 --- /dev/null +++ b/test-resources/task-definition-run-task.json @@ -0,0 +1,32 @@ +{ + "containerDefinitions": [ + { + "entryPoint": [ + "sh", + "-c" + ], + "portMappings": [ + { + "hostPort": 80, + "protocol": "tcp", + "containerPort": 80 + } + ], + "command": [ + "/bin/sh -c \"echo '
Your application is now running on a container in Amazon ECS.