Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Prometheus IP Script
uses: psf/black@stable
with:
src: "prometheus_ip_script"

- name: IRISCAST Energy Monitoring
- name: Aquilon Zombie Finder
uses: psf/black@stable
with:
src: "iriscasttools/iriscasttools"
src: "aq_zombie_finder"

- name: Aquilon Zombie Finder
uses: psf/black@stable
with:
src: "aq_zombie_finder"

- name: DNS Entry Checker
- name: DNS Entry Checker
uses: psf/black@stable
with:
src: "dns_entry_checker"
src: "dns_entry_checker"

- name: Word Cloud Generator
- name: Word Cloud Generator
uses: psf/black@stable
with:
src: "word_cloud_generator"
src: "word_cloud_generator"

- name: JSM Metric Collection
uses: psf/black@stable
with:
src: "jsm_metric_collection"
src: "jsm_metric_collection"

- name: Openstack-Rally-Tester
uses: psf/black@stable
with:
src: "OpenStack-Rally-Tester"
src: "OpenStack-Rally-Tester"
91 changes: 91 additions & 0 deletions .github/workflows/iriscast_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: IRISCAST Bump, Build and Release

on:
workflow_dispatch:
inputs:
bump-type:
description: 'Bump type'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: "Setup Github Token"
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Setting up git config
shell: bash
env:
GH_TOKEN: "${{ steps.app-token.outputs.token }}"
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
git config -l

- name: Install bump-my-version
shell: bash
run: pip install "bump-my-version"

- name: Pass Inputs to Shell
id: bump
shell: bash
run: |
cd iriscasttools/
echo "previous-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT

bump-my-version bump ${{ inputs.bump-type }}
([[ $? -gt 0 ]] && echo "bumped=false" || echo "bumped=true") >> $GITHUB_OUTPUT
echo "current-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT

- name: Push changes to GitHub
uses: ad-m/github-push-action@master
with:
github_token: "${{ steps.app-token.outputs.token }}"
branch: master
force: true

- name: Check
if: steps.bump.outputs.bumped == 'true'
run: |
echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!"

- name: Build package
if: steps.bump.outputs.bumped == 'true'
run: |
cd iriscasttools/
pip install build
python -m build

- name: Create GitHub Release
if: steps.bump.outputs.bumped == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: iriscasttools-v${{ steps.bump.outputs.current-version }}
name: iriscasttools-v${{ steps.bump.outputs.current-version }}
files: iriscasttools/dist/*
token: "${{ steps.app-token.outputs.token }}"


137 changes: 0 additions & 137 deletions .github/workflows/iriscast_package_build.yaml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/iriscast_unittest.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there steps missing from this workflow? I cannot see any tests being run.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed - tests are running

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: IRISCAST Unittest

on:
push:
branches:
- master
paths:
- "iriscasttools/**"
- ".github/workflows/iriscast_unittest.yaml"
pull_request:
paths:
- "iriscasttools/**"
- ".github/workflows/iriscast_unittest.yaml"

jobs:
test_and_lint:
runs-on: ubuntu-latest

defaults:
run:
working-directory: iriscasttools

strategy:
matrix:
python-version: ["3.10", "3.13"]

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Navigate to iriscasttools project
run: cd iriscasttools

- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}

- name: Install the project
run: uv sync --locked --all-extras

- name: Run tests
# For example, using `pytest`
run: uv run pytest tests

- name: Run pylint
run: uv run pylint iriscasttools tests
Loading