-
-
Notifications
You must be signed in to change notification settings - Fork 11
83 lines (72 loc) · 2.32 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Tests
on:
workflow_call:
secrets:
AWS_ACCOUNT_ID:
description: AWS account in which tests will run
required: true
SLACK_BOT_TOKEN:
description: Token used to send messages to Slack
required: true
env:
KUBECONFIG: /tmp/kubeconfig
SLACK_CHANNEL: '#mission-control'
jobs:
plan:
name: Test
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: "arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/flightdeck-ci"
- name: Assume execution role
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-region: us-east-1
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ env.AWS_SESSION_TOKEN }}
role-duration-seconds: 3000
role-skip-session-tagging: true
role-to-assume: "arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/flightdeck-ci-execution"
- name: Set up Kubernetes context
run: |
CLUSTER=$(echo 'flightdeck-${{ github.ref_name }}' | cut -c1-20)
CLUSTER="$CLUSTER-sandbox-v1"
echo "CLUSTER=$CLUSTER" >> "$GITHUB_ENV"
aws \
--region us-east-1 \
eks \
update-kubeconfig \
--name "$CLUSTER"
- name: Build manifests
id: kustomize
uses: azure/[email protected]
with:
renderEngine: kustomize
kustomizationPath: tests/manifests
- name: Deploy test app
uses: Azure/k8s-deploy@v4
with:
manifests: ${{ steps.kustomize.outputs.manifestsBundle }}
namespace: acceptance
- name: Run tests
run: |
make tests \
ADDRESS=https://${{ github.ref_name }}.flightdeck-test.thoughtbot.com \
CLUSTER="$CLUSTER"
- name: Notify Slack
if: failure()
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
with:
channel-id: ${{ env.SLACK_CHANNEL }}
slack-message: "Flightdeck acceptance tests have failed on the testing cluster."
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}