-
-
Notifications
You must be signed in to change notification settings - Fork 26
41 lines (40 loc) · 1.35 KB
/
test.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
name: Test
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
workflow_dispatch:
jobs:
test:
strategy:
matrix:
os: [ 'ubuntu-20.04' ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
runs-on: ${{ matrix.os }}
steps:
- uses: ankane/setup-elasticsearch@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: pipx install poetry
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest --cov=sigma --cov-report term --cov-report xml:cov.xml -vv
- name: Store coverage for badge
if: ${{ runner.os == 'Linux' }}
run: poetry run python print-coverage.py >> $GITHUB_ENV
- name: Create coverage badge
if: ${{ github.repository == 'SigmaHQ/pySigma-backend-elasticsearch' && github.event_name == 'push' && runner.os == 'Linux' }}
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 3c445ef26310e9f2d2ca09c697db1c71
filename: SigmaHQ-pySigma-backend-elasticsearch.json
label: Coverage
message: ${{ env.COVERAGE }}
color: ${{ env.COVERAGE_COLOR }}