Repository navigation
152 lines (122 loc) · 3.75 KB
/
Copy pathpull-request-checks.yml
File metadata and controls
152 lines (122 loc) · 3.75 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Pull Request Checks
on:
pull_request:
branches: [master]
workflow_dispatch:
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install python dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip setuptools wheel
pip install -r requirements/requirements.dev.txt --no-deps --prefer-binary --require-hashes
- name: Run Ruff Linter
run: |
source venv/bin/activate
ruff check
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install python dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip setuptools wheel
pip install -r requirements/requirements.dev.txt --no-deps --prefer-binary --require-hashes
- name: Run Unit Tests
run: |
source venv/bin/activate
pytest -m 'not integration'
integration-tests:
needs: [ruff, unit-tests]
env:
AWS_REGION: us-east-1
permissions:
id-token: write
contents: read
# This will only run on test
runs-on: codebuild-bb-test-web-server-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Checkout Code
uses: actions/checkout@v7
- name: Setup AWS credentials
uses: ./.github/actions/setup-tofu
with:
environment: test
non-prod-account: ${{ secrets.NON_PROD_ACCOUNT }}
prod-account: ${{ secrets.PROD_ACCOUNT }}
test-role-id: ${{ secrets.TEST_AWS_ROLE_ID_MASK }}
prod-role-id: ${{ secrets.PROD_AWS_ROLE_ID_MASK }}
- name: Build BBAPI
run: |
cd ./ops/containers/bb-api
make build-codebuild
- name: Build MSLSX
run: |
cd ./ops/containers/mslsx
make build-local
- name: Start Stack
run: |
cd ./ops/containers/bb-api
make run-codebuild-mock
- name: Execute Integration Tests
run: |
cd ./ops/containers/bb-api
make run-codebuild-integration
- name: Teardown Stack
if: always()
run: |
cd ./ops/containers/bb-api
make teardown-codebuild
selenium-tests:
needs: [ruff, unit-tests]
env:
AWS_REGION: us-east-1
permissions:
id-token: write
contents: read
# This will only run on test
runs-on: codebuild-bb-test-web-server-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Checkout Code
uses: actions/checkout@v7
- name: Setup AWS credentials
uses: ./.github/actions/setup-tofu
with:
environment: test
non-prod-account: ${{ secrets.NON_PROD_ACCOUNT }}
prod-account: ${{ secrets.PROD_ACCOUNT }}
test-role-id: ${{ secrets.TEST_AWS_ROLE_ID_MASK }}
prod-role-id: ${{ secrets.PROD_AWS_ROLE_ID_MASK }}
- name: Build MSLSX
run: |
cd ./ops/containers/mslsx
make build-local
- name: Build BBAPI
run: |
cd ./ops/containers/bb-api
make build-codebuild
- name: Build Selenium
run: |
cd ./ops/containers/bb-api
make build-selenium
- name: Start Stack
run: |
cd ./ops/containers/bb-api
make run-codebuild-mock
- name: Execute Selenium Tests
run: |
cd ./ops/containers/bb-api
make run-codebuild-selenium
- name: Teardown Stack
if: always()
run: |
cd ./ops/containers/bb-api
make teardown-codebuild-selenium