-
Notifications
You must be signed in to change notification settings - Fork 9
116 lines (96 loc) · 3.1 KB
/
gating.yaml
File metadata and controls
116 lines (96 loc) · 3.1 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
---
name: Gating
"on":
pull_request:
push:
workflow_dispatch:
inputs: {}
jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
python-version: "3.13"
- name: Test with tox
run: uvx --with tox-uv tox -e py3
- name: Collect coverage with Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: |
uvx --with coveralls coveralls --service=github
- name: Upload coverage to Coveralls
run: |
uvx --with coveralls coveralls --finish --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linters:
name: Linters
strategy:
matrix:
tox_env:
- mypy
- semgrep
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
python-version: "3.13"
- name: Test '${{ matrix.tox_env }}' with tox
run: uvx --with tox-uv tox -e ${{ matrix.tox_env }}
hadolint:
name: Hadolint
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile:
- Dockerfile
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
with:
dockerfile: ${{ matrix.dockerfile }}
# Ignore list:
# * DL3041 - Specify version with dnf install -y <package>-<version>
ignore: DL3041
failure-threshold: warning
image-build:
name: Container Image Build
needs: hadolint
runs-on: ubuntu-latest
env:
IMAGE_NAME: greenwave
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
python-version: "3.13"
enable-cache: true
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
with:
image: ${{ env.IMAGE_NAME }}
tags: >-
${{ github.ref == 'refs/heads/master' && 'latest' || '' }}
${{ github.sha }}
containerfiles: Dockerfile
build-args: |
SHORT_COMMIT=${{ github.sha }}
COMMIT_TIMESTAMP=1
EXPIRES_AFTER=${{ github.ref == 'refs/heads/master' && 'never' || '30d' }}
- name: Test Image
env:
GREENWAVE_LISTENERS: '0'
SHORT_COMMIT: '${{ github.sha }}'
COMMIT_TIMESTAMP: '1'
run: |
.github/run-functional-tests.sh "${{ steps.build-image.outputs.image }}:${{ github.sha }}"