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
52 changes: 52 additions & 0 deletions .github/workflows/update-solver-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update Solver API
on:
schedule:
- cron: '0 6 * * *'
jobs:
update-dep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.9

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements_*.txt') }}
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Install pyfluent
run: make install

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.REPO_DOWNLOAD_PAT }}

- name: Pull Fluent docker image
run: make docker-pull

- name: Run API codegen
run: make api-codegen

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.API_CODEGEN_PAT }}
commit-message: Update Solver API
title: Update Solver API
body: |
- Update Solver API

Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
branch: feat/update-solver-api
Copy link
Collaborator

Choose a reason for hiding this comment

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

So, you activate this by creating a branch with this name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The branch should also be automatically created by this action as per the doc.

(I'm yet to test this in github. There doesn't seem to be a way to run new workflows from a branch in github. So we can check how this is working in its first scheduled run after the PR is merged.)

Copy link
Collaborator

@dnwillia-work dnwillia-work May 10, 2022

Choose a reason for hiding this comment

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

Right, ok, I see you have it on a cron schedule, but it's not clear to me then how it 'detects' if there is an API change requiring regeneration of the code.

8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ unittest:
@echo "Running unittest"
@pip install -r requirements_test.txt
@pytest -v --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc

api-codegen:
@echo "Running API codegen"
@pip install -r requirements_codegen.txt
@python codegen/pyprotogen.py
@python codegen/tuigen.py
@python codegen/settingsgen.py
@python codegen/datamodelgen.py