-
Notifications
You must be signed in to change notification settings - Fork 24
159 lines (156 loc) · 4.49 KB
/
build.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
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
153
154
155
156
157
158
159
name: Build Django CQRS
on:
push:
branches: "*"
tags:
- '*'
pull_request:
branches: [ master ]
jobs:
build_3_8_9_10_11_django_3_2:
name: Build on Python ${{ matrix.python-version }} and django 3.2
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
poetry run pip install django==3.2.*
- name: Linting
run: |
poetry run flake8
- name: Testing
run: |
poetry run pytest
build_3_11_django_4_2:
name: Build on Python 3.11 django 4.2
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
poetry run pip install django==4.2.*
- name: Linting
run: |
poetry run flake8
- name: Testing
run: |
poetry run pytest
build_3_10_django_4_1:
name: Build on Python 3.10 django 4.1
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
poetry run pip install django==4.1.*
- name: Linting
run: |
poetry run flake8
- name: Testing
run: |
poetry run pytest
sonar:
name: Sonar Checks
needs: [build_3_8_9_10_11_django_3_2, build_3_11_django_4_2, build_3_10_django_4_1]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python '3.10'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
poetry run pip install django==4.2.*
- name: Testing
run: |
poetry run pytest
- name: Fix coverage report for Sonar
run: |
sed -i 's/\/home\/runner\/work\/django-cqrs\/django-cqrs\//\/github\/workspace\//g' ./tests/reports/coverage.xml
- name: SonarCloud
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Wait sonar to process report
uses: jakejarvis/wait-action@master
with:
time: '15s'
- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
compatibility:
name: Compatibility and Integration Tests
needs: [sonar]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python '3.10'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Integration tests
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
INTEGRATION_TESTS: yes
run: |
./travis_integration_tests.sh
- name: Compatibility tests
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
COMPAT_TESTS: yes
run: |
./travis_compat_tests.sh