-
Notifications
You must be signed in to change notification settings - Fork 20
87 lines (83 loc) · 2.86 KB
/
CI.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
# This workflow executes CI jobs
name: CI
on:
push:
branches:
- main
- development
pull_request:
branches: '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# Build job focuses on maintaining quality bar of code contributed in each commit.
# Enforce static analysis, commit format and code coverage rules etc. here.
# To perform any testing on gdk-cli tool, please add them to the regression job.
build:
strategy:
matrix:
python-version: [ 3.7 ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
name: Build on ${{ matrix.os }} with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Validate commit messages
uses: wagoid/commitlint-github-action@v5
if: matrix.os == 'ubuntu-latest'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Python version
run: |
python -VV
python -m pip install --upgrade pip
- name: Lint with flake8
run: |
pip install flake8
# The GitHub editor is 127 chars wide
flake8 .
- name: Install test dependencies
run: |
pip install -r test-requirements.txt
- name: Unit Testing CLI
run: |
make tests_unit
- name: Upload tests coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: unit
- name: Integration Testing CLI
run: |
make tests_integration
- name: Upload integration tests coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: integ
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{secrets.GDK_WORKFLOW_AWS_ROLE}}
aws-region: us-east-1
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'}}
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: 8
distribution: corretto
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'}}
- name: Run UATs with code coverage
run: |
make tests_uat
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'}}
- name: Upload UAT coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: uat
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'}}