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
75 changes: 75 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: ci

on:
schedule:
- cron: "0 */4 * * *"

jobs:
setup:
runs-on: ubuntu-latest
if: github.repository == 'simulationcraft/simc-profile' && github.ref_name == github.event.repository.default_branch

outputs:
cache-key: simc-clang++-18-cpp17-${{ env.SHA }}
cache-hit: ${{ steps.restore_cache.outputs.cache-hit }}

steps:
- uses: actions/checkout@v6
with:
repository: simulationcraft/simc
path: simc-profile/simc/

- name: cache_key
shell: bash
run: |
cd simc-profile/simc/
echo "SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
cd ../..

- uses: actions/cache/restore@v5
id: restore_cache
continue-on-error: true
with:
path: simc-profile/simc/b/ninja/simc
key: simc-clang++-18-cpp17-${{ env.SHA }}
lookup-only: true

ci:
runs-on: ubuntu-latest
needs: setup
if: ${{ !fromJson( needs.setup.outputs.cache-hit ) }}

steps:
- uses: actions/checkout@v6
if: ${{

- name: validate_python_main
run: |
find ${{ runner.workspace }}/simc-profile/profiles -type f \
| xargs python ${{ runner.workspace }}/simc-profile/scripts/validate.py \
--validate

- name: validate_seasonal_python_main
run: |
find ${{ runner.workspace }}/simc-profile/profiles -type f \
| xargs python ${{ runner.workspace }}/simc-profile/scripts/validate.py \
--validate-seasonal

- uses: ./.github/workflows/build
id: build
with:
cache-key: ${{ fromJson( needs.setup.outputs.cache-key }}

- name: validate_simc_main
run: |
find ${{ runner.workspace }}/simc-profile/profiles -type f \
| xargs python ${{ runner.workspace }}/simc-profile/scripts/execute.py \
-b ${{ runner.workspace }}/simc-profile/simc-profile/simc/b/ninja/simc \
--save .

- name: execute_simc_main
run: |
find ${{ runner.workspace }}/simc-profile/profiles -type f \
| xargs python ${{ runner.workspace }}/simc-profile/scripts/execute.py \
-b ${{ runner.workspace }}/simc-profile/simc-profile/simc/b/ninja/simc \
--execute .
44 changes: 44 additions & 0 deletions .github/workflows/ci-pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: ci-pullrequest

on:
pull_request

jobs:
CI:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2

- name: modified_files
run: |
files=$(git diff --diff-filter=AM --no-commit-id --name-only HEAD~1 -- '***.simc' | xargs)
echo "MODIFIED_FILES=$files" >> $GITHUB_ENV

- name: validate_python
run: |
python ${{ runner.workspace }}/simc-profile/scripts/validate.py \
${{ env.MODIFIED_FILES }} --validate

- name: validate_seasonal_python_pr
if: github.event_name == 'pull_request'
run: |
python ${{ runner.workspace }}/simc-profile/scripts/validate.py \
${{ env.MODIFIED_FILES }} --validate-seasonal

- uses: ./.github/workflows/setup_simc
id: setup

- name: validate_simc_pr
run: |
python ${{ runner.workspace }}/simc-profile/scripts/execute.py \
${{ env.MODIFIED_FILES }} -b ${{ runner.workspace }}/simc-profile/simc-profile/simc/b/ninja/simc \
--save .

- name: execute_simc_pr
run: |
python ${{ runner.workspace }}/simc-profile/scripts/execute.py \
${{ env.MODIFIED_FILES }} -b ${{ runner.workspace }}/simc-profile/simc-profile/simc/b/ninja/simc \
--execute .
74 changes: 0 additions & 74 deletions .github/workflows/main.yml

This file was deleted.