-
Notifications
You must be signed in to change notification settings - Fork 171
105 lines (99 loc) · 3.13 KB
/
tests.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
permissions:
id-token: write
contents: read
name: Run Tests
on:
pull_request:
branches:
- '*'
concurrency: staging_environment
jobs:
test-cli:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- {python-version: '3.7', os: ubuntu-latest, dashboard: cudos }
- {python-version: '3.8', os: macos-latest, dashboard: cudos }
- {python-version: '3.9', os: ubuntu-latest, dashboard: cudos }
- {python-version: '3.10', os: macos-latest, dashboard: cudos }
steps:
- name: Git clone the repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
pip install ./
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: ${{ secrets.AWS_SESSION_NAME }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Basic check
run: |
cid-cmd status
- name: Install Bats
run: |
sudo apt-get install -y bats
- name: Check Bats Verson
run: |
bats -v
- name: Run Bats Tests
run: |
bats cid/test/bats/10-deploy-update-delete/${{ matrix.dashboard }}.bats
- name: Save logs
if: always()
run: |
aws s3 cp ./cid.log s3://aws-cid-stage-logs/$GITHUB_EVENT_NAME/$GITHUB_REF_NAME/$GITHUB_RUN_NUMBER/python${{ matrix.python-version }}-${{ matrix.os }}/
publish-lambda-layer:
needs: test-cli
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
steps:
- name: Git clone the repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install
run: |
python -m pip install --upgrade pip
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: ${{ secrets.AWS_SESSION_NAME }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Push LambdaLayer to S3
run: |
./assets/publish_lambda_layer.sh
test-cfn:
needs: publish-lambda-layer
runs-on: 'ubuntu-latest'
steps:
- name: Git clone the repository
uses: actions/checkout@v3
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: ${{ secrets.AWS_SESSION_NAME }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Install Bats
run: |
sudo apt-get install -y bats
bats -v
- name: Run Bats Tests for CloudFormation
run: |
export lambda_bucket='aws-cid-stage'
# bats cfn-templates/cid-cfn.tests.bats