Skip to content
Open
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
78 changes: 78 additions & 0 deletions .github/workflows/generate_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: generate-files

on:
workflow_call:
inputs:
cache-sha:
type: string
required: true

jobs:
update-generated-files:
runs-on: ubuntu-22.04

steps:
- uses: actions/cache@v4
id: cache
with:
path: |
${{ runner.workspace }}/b/ninja/simc
profiles
tests
generate_profiles_ci.sh
.git
key: ubuntu-clang++-15-for_run-${{ inputs.cache-sha }}-cpp-17

- uses: actions/checkout@v4

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

- name: Generate APL Modules
if: steps.cache.outputs.cache-hit == 'true'
env:
SIMC_CLI_PATH: ${{ runner.workspace }}/b/ninja/simc
run: ${{ github.workspace }}/generate_apl_modules_ci.sh

- name: Download APL Dumps
uses: actions/download-artifact@v4
with:
path: ActionPriorityLists
pattern: apl-${{ inputs.cache-sha }}-*
merge-multiple: true

- name: Generate Profiles
if: steps.cache.outputs.cache-hit == 'true'
continue-on-error: true
env:
SIMC_CLI_PATH: ${{ runner.workspace }}/b/ninja/simc
run: ${{ github.workspace }}/generate_profiles_ci.sh

- name: Dump Spell Data
if: steps.cache.outputs.cache-hit == 'true'
env:
SIMC_CLI_PATH: ${{ runner.workspace }}/b/ninja/simc
run: ${{ github.workspace}}/SpellDataDump/spelldatadump_ci.sh

- name: Check for Non-Trivial Changes
run: |
if [ "$(git ls-files -m)" = "SpellDataDump/build_info.txt" ]; then
git checkout -- SpellDataDump/build_info.txt
fi

- name: Commit Updated Files
continue-on-error: true
uses: EndBug/add-and-commit@v9
with:
message: "Update Generated Files ${{ 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"
- "*.simc"
- "*.txt"

- name: Cleanup APL Dumps
uses: geekyeggo/delete-artifact@v5
with:
name: apl-${{ inputs.cache-sha }}-*
136 changes: 39 additions & 97 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ env:
ccache-generation: 0 # bump if you need to "clean" ccache

jobs:
test-job:
runs-on: ubuntu-22.04
steps:
- name: Test
run:
echo "${{github.ref}} ${{github.event.repository.defaultBranchRef}} ${{github.ref_name}}"

ubuntu-gcc-build:
name: ubuntu-${{ matrix.compiler }}-cpp${{ matrix.cppVersion }}-build
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -150,102 +157,6 @@ jobs:
.git
key: ubuntu-${{ matrix.compiler }}-for_run-${{ github.sha }}-cpp-${{ matrix.cppVersion }}

spec-test:
needs: [ubuntu-clang-build]
if: github.ref_name == 'thewarwithin' || github.ref_name == 'midnight'
uses: ./.github/workflows/spec_test.yml
with:
cache-key: ubuntu-clang++-15-for_run-${{ github.sha }}-cpp-17
cache-sha: ${{ github.sha }}
is-ptr: false

spec-test-ptr:
needs: [spec-test, ubuntu-clang-build]
uses: ./.github/workflows/spec_test.yml
with:
cache-key: ubuntu-clang++-15-for_run-${{ github.sha }}-cpp-17
cache-sha: ${{ github.sha }}
is-ptr: true

update-generated-files:
name: Update Generated Files
needs: [spec-test]
runs-on: ubuntu-22.04
if: github.event_name == 'push' && ( success() || failure() ) && github.repository == 'simulationcraft/simc'

steps:
- uses: actions/cache@v4
id: cache
with:
path: |
${{ runner.workspace }}/b/ninja/simc
profiles
tests
generate_profiles_ci.sh
.git
key: ubuntu-clang++-15-for_run-${{ github.sha }}-cpp-17

- uses: actions/checkout@v4

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

- name: Generate APL Modules
if: steps.cache.outputs.cache-hit == 'true'
env:
SIMC_CLI_PATH: ${{ runner.workspace }}/b/ninja/simc
run: ${{ github.workspace }}/generate_apl_modules_ci.sh

- name: Download APL Dumps
uses: actions/download-artifact@v4
with:
path: ActionPriorityLists
pattern: apl-${{ github.sha }}-*
merge-multiple: true

- name: Generate Profiles
if: steps.cache.outputs.cache-hit == 'true'
continue-on-error: true
env:
SIMC_CLI_PATH: ${{ runner.workspace }}/b/ninja/simc
run: ${{ github.workspace }}/generate_profiles_ci.sh

- name: Dump Spell Data
if: steps.cache.outputs.cache-hit == 'true'
env:
SIMC_CLI_PATH: ${{ runner.workspace }}/b/ninja/simc
run: ${{ github.workspace}}/SpellDataDump/spelldatadump_ci.sh

- name: Check for Non-Trivial Changes
run: |
if [ "$(git ls-files -m)" = "SpellDataDump/build_info.txt" ]; then
git checkout -- SpellDataDump/build_info.txt
fi

- name: Commit Updated Files
continue-on-error: true
uses: EndBug/add-and-commit@v9
with:
message: "Update Generated Files ${{ 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"
- "*.simc"
- "*.txt"

- name: Cleanup APL Dumps
uses: geekyeggo/delete-artifact@v5
with:
name: apl-${{ github.sha }}-*

ubuntu-run:
needs: [ubuntu-clang-build, ubuntu-gcc-build]
if: github.ref_name == 'thewarwithin'
uses: ./.github/workflows/ubuntu_run.yml
with:
cache-sha: ${{ github.sha }}

build-osx:
name: macos-latest
runs-on: macos-latest
Expand All @@ -256,7 +167,7 @@ jobs:
run: make SANITIZE=1 -C engine debug -j 2

- name: Smoke Test
if: github.ref_name == 'thewarwithin'
if: github.ref == github.event.repository.defaultBranchRef || github.ref_name == 'midnight'
run: ./engine/simc $SIMC_PROFILE iterations=5 output=/dev/null html=/dev/null json2=/dev/null cleanup_threads=1

windows-VS:
Expand Down Expand Up @@ -295,3 +206,34 @@ jobs:
- name: Smoke Test
if: matrix.runSmokeTest
run: ${{ env.CMAKE_BUILD_DIR }}/simc.exe $env:SIMC_PROFILE iterations=5 output=nul html=nul json2=nul cleanup_threads=1

spec-test:
needs: [ubuntu-clang-build]
if: github.ref == github.event.repository.defaultBranchRef || github.ref_name == 'midnight'
uses: ./.github/workflows/spec_test.yml
with:
cache-key: ubuntu-clang++-15-for_run-${{ github.sha }}-cpp-17
cache-sha: ${{ github.sha }}
is-ptr: false

spec-test-ptr:
needs: [spec-test, ubuntu-clang-build]
uses: ./.github/workflows/spec_test.yml
with:
cache-key: ubuntu-clang++-15-for_run-${{ github.sha }}-cpp-17
cache-sha: ${{ github.sha }}
is-ptr: true

ubuntu-run:
needs: [ubuntu-clang-build, ubuntu-gcc-build]
if: github.ref == github.event.repository.defaultBranchRef || github.ref_name == 'midnight'
uses: ./.github/workflows/ubuntu_run.yml
with:
cache-sha: ${{ github.sha }}

update-generated-files:
needs: [spec-test]
if: github.event_name == 'push' && ( success() || failure() ) && github.repository == 'simulationcraft/simc' && github.ref == github.event.repository.defaultBranchRef
uses: ./.github/workflows/generate_files.yml
with:
cache-sha: ${{ github.sha }}
Loading