Skip to content

Commit

Permalink
New workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
AcerP-py committed Dec 30, 2024
1 parent 7643f05 commit b896b60
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 59 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
release:
types:
- published

name: build

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.ref_name }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
fetch-tags: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build Python Package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
26 changes: 11 additions & 15 deletions .github/workflows/documentation.yml → .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# Deploy Velocity documentation
name: Deploy Documentation to Pages

on:
# trigger on push to develop also allow manual runs
push:
branches: ["develop"]
workflow_dispatch:
branches:
- develop
workflow_dispatch: { }

name: docs

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
Expand All @@ -26,24 +22,24 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout Develop
uses: actions/checkout@v4
with:
ref: "develop"
ref: develop
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
python-version: '3.12'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx-rtd-theme sphinx-copybutton
- name: Build Docs
run: |
cd docs && make html
- name: Upload documentation HTML files
- name: Upload HTML Files
uses: actions/upload-pages-artifact@v3
with:
path: './docs/build/html'
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
branches:
- develop
- releases/**
pull_request:
branches:
- develop
- releases/**

name: Lint Code

jobs:
lint:
name: Run Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "${{ github.ref }}"
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: |
python -m pip install --upgrade pip
pip install ruff
- run: |
python3 -m unittest
43 changes: 0 additions & 43 deletions .github/workflows/python-publish.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
push:
tags:
- v[0-9]*

run-name: Release ${{ github.ref_name }}

permissions:
contents: write

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.ref }}
- env:
GH_TOKEN: ${{ github.token }}
run: |
echo "LATEST_RELEASE=$(gh release list | awk '$2 == "Latest" {print $3}')" >> "$GITHUB_ENV"
- env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
--repo="$GITHUB_REPOSITORY" \
--title="${{ github.ref_name }}" \
--notes="Changes between: $LATEST_RELEASE..${{ github.ref_name }}\n$(git log $LATEST_RELEASE..${{ github.ref_name }} --oneline --decorate=false)"
25 changes: 25 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
push:
branches:
- develop
- releases/**
pull_request:
branches:
- develop
- releases/**

name: Run Unit Tests

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "${{ github.ref }}"
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: |
python3 -m unittest
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

-----------------------------------------------------------

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/olcf/velocity/tests?event=push&style=flat-square&label=test)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/olcf/velocity/docs?branch=develop&event=push&style=flat-square&label=deploy%20docs)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/olcf/velocity/build?event=release&style=flat-square&label=build)
[![PyPI - Version](https://img.shields.io/pypi/v/olcf-velocity?style=flat-square&color=%23FFD242)](https://pypi.org/project/olcf-velocity)
[![Spack](https://img.shields.io/spack/v/py-olcf-velocity?style=flat-square&color=%230F3A80)](https://packages.spack.io/package.html?name=py-olcf-velocity)

## Description
Velocity is a tool to help with the maintenance of container build scripts on
multiple systems, backends (e.g podman or apptainer) and distros.
Expand All @@ -13,4 +19,5 @@ See <https://olcf.github.io/velocity/>.
``` commandline
pip install olcf-velocity
alias velocity="python3 -m velocity"
velocity
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exclude = [
]
line-length = 120
indent-width = 4
target-version = "py310"
target-version = "py312"

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F"]
Expand Down

0 comments on commit b896b60

Please sign in to comment.