Skip to content

Commit

Permalink
Update Workflow (#4)
Browse files Browse the repository at this point in the history
* ci: πŸ€– Add coverage badge

* ci: πŸ€– Add release.yml

* docs: πŸ“š Add Coverage Badge
  • Loading branch information
frack113 authored Mar 17, 2024
1 parent 819eb98 commit 9267522
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 17 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release to PyPI
on:
release:
types: [published]
push:
tags:
- v*.*.*

jobs:
build-and-publish:
runs-on: ubuntu-20.04
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Verify versioning
run: |
[ "$(poetry version -s)" == "${GITHUB_REF#refs/tags/v}" ]
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest
- name: Build packages
run: poetry build
- name: Publish to test PyPI
if: ${{ github.event_name == 'push' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: ${{ github.event_name == 'release' }}
uses: pypa/gh-action-pypi-publish@release/v1
23 changes: 10 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ jobs:
run: poetry run black --check .
- 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 == 'frack113/pySigma_validators_sigmaHQ' && github.event_name == 'push' && runner.os == 'Linux' }}
# uses: schneegans/dynamic-badges-action@v1.7.0
# with:
# auth: ${{ secrets.GIST_SECRET }}
# gistID: 13cc99342f8578eac75f46f67e5fd023
# filename: frack113-validators-coverage.json
# label: Coverage
# message: ${{ env.COVERAGE }}
# color: ${{ env.COVERAGE_COLOR }}
- name: Create coverage badge
if: ${{ github.repository == 'SigmaHQ/pySigma-validators-sigmaHQ' && github.event_name == 'push' && runner.os == 'Linux' }}
uses: schneegans/dynamic-badges-action@v1.1.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: b27ee1cbe964fb1a299cc20c3403f8c8
filename: pySigma-validators-sigmaHQ.json
label: Coverage
message: ${{ env.COVERAGE }}
color: ${{ env.COVERAGE_COLOR }}
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# pySigma_validators_sigmaHQ
<!-- Workflow needs to be updated
![Tests](https://github.com/frack113/pySigma_validators_sigmaHQ/actions/workflows/test.yml/badge.svg)
![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/frack113/13cc99342f8578eac75f46f67e5fd023/raw/frack113-validators-coverage.json)
![Tests](https://github.com/SigmaHQ/pySigma-validators-sigmaHQ/actions/workflows/test.yml/badge.svg)
![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/frack113/b27ee1cbe964fb1a299cc20c3403f8c8/raw/pySigma-validators-sigmaHQ.json)
![Status](https://img.shields.io/badge/Status-pre--release-orange)
-->

# Purpose

Create all validators specific to the requirements of the SigmaHQ rules repository
Expand Down

0 comments on commit 9267522

Please sign in to comment.