Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shaman] Use CI to generate code-gen'd APL files #9693

Draft
wants to merge 3 commits into
base: thewarwithin
Choose a base branch
from
Draft
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
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,48 @@ jobs:
with:
name: apl-${{ github.sha }}-*

update-generated-apl-modules:
name: Action Priority List Dump / Regenerate Profiles
runs-on: ${{ matrix.os }}
needs: [ spec-test, spelldata-dump ]
if: github.event_name == 'push' && ( success() || failure() ) && github.repository == 'simulationcraft/simc'

strategy:
fail-fast: false
matrix:
cppVersion: [17]
compiler: [clang++-15]
include:
- compiler: clang++-15
os: ubuntu-22.04

steps:
- uses: actions/cache@v4
with:
path: |
${{ runner.workspace }}/b/ninja/simc
key: ubuntu-${{ matrix.compiler }}-for_run-${{ github.sha }}-cpp-${{ matrix.cppVersion }}

- uses: actions/checkout@v4

- name: Setup
run: echo "SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV

- name: Run
env:
UBSAN_OPTIONS: print_stacktrace=1
SIMC_CLI_PATH: ${{ runner.workspace }}/b/ninja/simc
run: ${{ github.workspace }}/generate_apl_modules_ci.sh

- name: Commit code-generated APLs
continue-on-error: true
uses: EndBug/add-and-commit@v9
with:
message: 'Update generated APL modules ${{ env.SHORT_SHA }}'
default_author: github_actions
fetch: --no-tags --force --prune --no-recurse-submodules --depth=1 origin ${{ github.ref_name }}
add: 'engine/class_modules/apl'

ubuntu-run:
name: ubuntu-${{ matrix.compiler }}-cpp-${{ matrix.cppVersion }}-${{ matrix.type }}
runs-on: ${{ matrix.os }}
Expand Down
23 changes: 23 additions & 0 deletions generate_apl_modules_ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env sh
set -e

alias py=python3

ROOT=$(cd $(dirname $0)/.. && pwd)

if [ "$(pwd)" != "${ROOT}" ]; then
echo "you must run this script in the root directory for this repository" >&2
exit 1
fi

classes_to_generate=(
shaman
)

for class in $classes_to_generate; do
pushd "engine/class_modules/apl/${class}"
./generate_${class}.sh
popd
done

echo 'done'