-
Notifications
You must be signed in to change notification settings - Fork 3
166 lines (147 loc) · 4.38 KB
/
ci-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
160
161
162
163
164
165
166
name: CI Build
on:
push:
branches: ["*"]
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Pipenv
run: python -m pip install --upgrade pipenv
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cache Pipenv
id: cache-pipenv
uses: actions/cache@v4
with:
path: ~/.local/share/virtualenvs
key: pipenv-${{ hashFiles('Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: pipenv install --deploy --dev
- name: Set up locale
run: |
sudo locale-gen de_DE.UTF-8
sudo dpkg-reconfigure locales
- name: Run tests with coverage
run: pipenv run hbcoverage
env:
TEST_OUTPUT_FILE_NAME: unit.xml
- name: Generate coverage report
run: pipenv run coverage xml
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage report
path: coverage.xml
- name: Unit Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Unit Tests
path: unit.xml
reporter: java-junit
- name: Check format
run: pipenv run black src --check
- name: Check import order
run: pipenv run isort src --check
- name: Run Mypy
run: pipenv run mypy src
- name: Run Flake8
run: pipenv run flake8
- name: Run Pylint
run: pipenv run pylint src
coveralls:
runs-on: ubuntu-latest
needs: main
steps:
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage report
- uses: coverallsapp/github-action@v2
codacy:
runs-on: ubuntu-latest
needs: main
steps:
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage report
- uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
codeclimate:
runs-on: ubuntu-latest
needs: main
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage report
- uses: paambaati/codeclimate-action@v9
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
codecov:
runs-on: ubuntu-latest
needs: main
steps:
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage report
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
licenses:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: "Run FOSSA Scan"
uses: fossas/fossa-action@v1.3.3 # see https://github.com/fossas/fossa-action/issues/39
with:
api-key: ${{secrets.FOSSA_API_KEY}}
- name: "Run FOSSA Test"
uses: fossas/fossa-action@v1.3.3 # see https://github.com/fossas/fossa-action/issues/39
with:
api-key: ${{secrets.FOSSA_API_KEY}}
run-tests: true
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: buildx-${{ github.sha }}
restore-keys: |
buildx-
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
tags: djbrown/hbscorez:latest
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}