Skip to content

Commit e4aa92c

Browse files
authored
Merge pull request #265 from anish-mudaraddi/master
setup better python package builds for iriscasttools
2 parents e6bd6cf + 8f10490 commit e4aa92c

File tree

17 files changed

+918
-793
lines changed

17 files changed

+918
-793
lines changed

.github/workflows/black.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,33 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v5
10-
10+
1111
- name: Prometheus IP Script
1212
uses: psf/black@stable
1313
with:
1414
src: "prometheus_ip_script"
1515

16-
- name: IRISCAST Energy Monitoring
16+
- name: Aquilon Zombie Finder
1717
uses: psf/black@stable
1818
with:
19-
src: "iriscasttools/iriscasttools"
19+
src: "aq_zombie_finder"
2020

21-
- name: Aquilon Zombie Finder
22-
uses: psf/black@stable
23-
with:
24-
src: "aq_zombie_finder"
25-
26-
- name: DNS Entry Checker
21+
- name: DNS Entry Checker
2722
uses: psf/black@stable
2823
with:
29-
src: "dns_entry_checker"
24+
src: "dns_entry_checker"
3025

31-
- name: Word Cloud Generator
26+
- name: Word Cloud Generator
3227
uses: psf/black@stable
3328
with:
34-
src: "word_cloud_generator"
35-
29+
src: "word_cloud_generator"
30+
3631
- name: JSM Metric Collection
3732
uses: psf/black@stable
3833
with:
39-
src: "jsm_metric_collection"
34+
src: "jsm_metric_collection"
4035

4136
- name: Openstack-Rally-Tester
4237
uses: psf/black@stable
4338
with:
44-
src: "OpenStack-Rally-Tester"
39+
src: "OpenStack-Rally-Tester"
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: IRISCAST Bump, Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump-type:
7+
description: 'Bump type'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- major
13+
- minor
14+
- patch
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: "Setup Github Token"
25+
uses: actions/create-github-app-token@v2
26+
id: app-token
27+
with:
28+
app-id: ${{ vars.APP_ID }}
29+
private-key: ${{ secrets.PRIVATE_KEY }}
30+
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.11"
38+
39+
- name: Setting up git config
40+
shell: bash
41+
env:
42+
GH_TOKEN: "${{ steps.app-token.outputs.token }}"
43+
run: |
44+
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
45+
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
46+
git config -l
47+
48+
- name: Install bump-my-version
49+
shell: bash
50+
run: pip install "bump-my-version"
51+
52+
- name: Pass Inputs to Shell
53+
id: bump
54+
shell: bash
55+
run: |
56+
cd iriscasttools/
57+
echo "previous-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
58+
59+
bump-my-version bump ${{ inputs.bump-type }}
60+
([[ $? -gt 0 ]] && echo "bumped=false" || echo "bumped=true") >> $GITHUB_OUTPUT
61+
echo "current-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
62+
63+
- name: Push changes to GitHub
64+
uses: ad-m/github-push-action@master
65+
with:
66+
github_token: "${{ steps.app-token.outputs.token }}"
67+
branch: master
68+
force: true
69+
70+
- name: Check
71+
if: steps.bump.outputs.bumped == 'true'
72+
run: |
73+
echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!"
74+
75+
- name: Build package
76+
if: steps.bump.outputs.bumped == 'true'
77+
run: |
78+
cd iriscasttools/
79+
pip install build
80+
python -m build
81+
82+
- name: Create GitHub Release
83+
if: steps.bump.outputs.bumped == 'true'
84+
uses: softprops/action-gh-release@v2
85+
with:
86+
tag_name: iriscasttools-v${{ steps.bump.outputs.current-version }}
87+
name: iriscasttools-v${{ steps.bump.outputs.current-version }}
88+
files: iriscasttools/dist/*
89+
token: "${{ steps.app-token.outputs.token }}"
90+
91+

.github/workflows/iriscast_package_build.yaml

Lines changed: 0 additions & 137 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: IRISCAST Unittest
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "iriscasttools/**"
9+
- ".github/workflows/iriscast_unittest.yaml"
10+
pull_request:
11+
paths:
12+
- "iriscasttools/**"
13+
- ".github/workflows/iriscast_unittest.yaml"
14+
15+
jobs:
16+
test_and_lint:
17+
runs-on: ubuntu-latest
18+
19+
defaults:
20+
run:
21+
working-directory: iriscasttools
22+
23+
strategy:
24+
matrix:
25+
python-version: ["3.10", "3.13"]
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v6
30+
31+
- name: Navigate to iriscasttools project
32+
run: cd iriscasttools
33+
34+
- name: Install uv and set the Python version
35+
uses: astral-sh/setup-uv@v7
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
39+
- name: Install the project
40+
run: uv sync --locked --all-extras
41+
42+
- name: Run tests
43+
# For example, using `pytest`
44+
run: uv run pytest tests
45+
46+
- name: Run pylint
47+
run: uv run pylint iriscasttools tests

0 commit comments

Comments
 (0)