-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (74 loc) · 2.46 KB
/
prod.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
---
name: prod
on:
push:
branches:
- "main"
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
schedule:
- cron: "0 0 1 */1 *"
# - cron: "*/5 * * * *" # 5 min testing
jobs:
ci:
name: ci
runs-on: ubuntu-latest
env:
using_act: ${{ github.actor == 'nektos/act'}}
is_cron: ${{ github.event_name == 'schedule' }}
steps:
- name: Checkout.
uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: '3.8.x'
- uses: actions/setup-python@v5
with:
python-version: '3.9.x'
- uses: actions/setup-python@v5
with:
python-version: '3.10.x'
- uses: actions/setup-python@v5
with:
python-version: '3.11.x'
- uses: actions/setup-python@v5
with:
python-version: '3.12.x'
- name: Make sure path are there also for act shells.
if: env.using_act == 'true'
run: |
echo "export PATH=\"/opt/hostedtoolcache/Python/${{ env.python_version }}/x64:/opt/hostedtoolcache/Python/${{ env.python_version }}/x64/bin:$PATH\"" >> /root/.bashrc
- name: Upgrade pip.
run: python -m pip install --upgrade pip
- name: Install poetry and invoke.
run: pip install poetry invoke
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Install the first python venv
run: inv install -p latest
- name: Check formatting
run: inv checks
- name: Launch tests against all supported python versions
run: inv test-all-python-version --coverage
- name: Prepare the coveralls config.
run: |
echo "repo_token: ${{ secrets.COVERALLS_TOKEN }}" > .coveralls.yml
- name: Upload coverage stats
run: inv publish-coverage
- name: Fix source path in sonarqube coverage file.
if: ${{ !env.ACT }}
run: sed -i "s#`pwd`#/github/workspace#" coverage/sonarqube/coverage.xml
- uses: SonarSource/sonarqube-scan-action@master
if: ${{ !env.ACT }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- uses: CarloDePieri/sonarqube-scan-action@master
if: ${{ env.ACT }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}