Skip to content

[pre-commit.ci] pre-commit autoupdate (#105) #123

[pre-commit.ci] pre-commit autoupdate (#105)

[pre-commit.ci] pre-commit autoupdate (#105) #123

Workflow file for this run

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
old-version:
description: 'Override the old version for HELICS'
required: false
new-version:
description: 'Override the new version for HELICS'
required: false
version-constraint:
description: 'Optional version constraint for HELICS versions'
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Install cheader2json
run: |
pip install .
- id: gh-cli-auth
shell: bash
run: echo "${{github.token}}" | gh auth login --with-token
# Test against newest HELICS release
- id: newest-version
shell: bash
run: |
# list most recent 100 releases, ignore "Pre-release" lines, then get the most recent tag that matches
NEWEST_VERSION_MATCH=$(gh release list --repo GMLC-TDC/HELICS --limit 100 | grep -v "Pre-release" | cut -f3 | head -n1)
echo "version=$(echo $NEWEST_VERSION_MATCH)" >> $GITHUB_OUTPUT
- name: Test on a header file
run: |
HELICS_VERSION="${{steps.newest-version.outputs.version}}"
wget https://github.com/GMLC-TDC/HELICS/releases/download/${HELICS_VERSION}/Helics-shared-${HELICS_VERSION:1}-Linux-x86_64.tar.gz
tar xvf Helics-shared-${HELICS_VERSION:1}-Linux-x86_64.tar.gz
cheader2json convert Helics-${HELICS_VERSION:1}-Linux-x86_64/include/helics/helics.h
- uses: actions/upload-artifact@v4
with:
path: "*.json"
generate-diff:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Generate Diff
uses: ./actions/generate-diff
with:
pypi-version: 'main'
repository: 'GMLC-TDC/HELICS'
old-version: ${{ github.event.inputs.old-version || '' }}
new-version: ${{ github.event.inputs.new-version || '' }}
version-constraint: ${{ github.event.inputs.version-constraint || '^v3.*' }}
header-paths: 'src/helics/shared_api_library/backup/helics/helics.h'
working-directory: '${{ github.workspace }}/cheader2json-working-directory'