2022-01-26 17:31:32 +03:00
|
|
|
name: Regenerate framework models
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: "30 2 * * *"
|
2022-02-04 13:29:36 +03:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- ".github/workflows/mad_regenerate-models.yml"
|
2022-08-02 17:33:21 +03:00
|
|
|
- ".github/actions/fetch-codeql/action.yml"
|
2022-01-26 17:31:32 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
regenerate-models:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-02-04 13:29:36 +03:00
|
|
|
# placeholder required for each axis, excluded below, replaced by the actual combinations (see include)
|
2022-01-26 17:31:32 +03:00
|
|
|
slug: ["placeholder"]
|
|
|
|
ref: ["placeholder"]
|
|
|
|
include:
|
|
|
|
- slug: "apache/commons-io"
|
2022-05-22 16:33:31 +03:00
|
|
|
ref: "13258ce2d07aa0e764bbaa8020af4dcd3a02a620"
|
2022-01-26 17:31:32 +03:00
|
|
|
exclude:
|
|
|
|
- slug: "placeholder"
|
|
|
|
ref: "placeholder"
|
|
|
|
steps:
|
|
|
|
- name: Clone self (github/codeql)
|
2023-09-05 06:07:18 +03:00
|
|
|
uses: actions/checkout@v4
|
2022-01-26 17:31:32 +03:00
|
|
|
- name: Setup CodeQL binaries
|
|
|
|
uses: ./.github/actions/fetch-codeql
|
|
|
|
- name: Clone repositories
|
2023-09-05 06:07:18 +03:00
|
|
|
uses: actions/checkout@v4
|
2022-01-26 17:31:32 +03:00
|
|
|
with:
|
|
|
|
path: repos/${{ matrix.ref }}
|
|
|
|
ref: ${{ matrix.ref }}
|
|
|
|
repository: ${{ matrix.slug }}
|
|
|
|
- name: Build database
|
|
|
|
env:
|
|
|
|
SLUG: ${{ matrix.slug }}
|
|
|
|
REF: ${{ matrix.ref }}
|
|
|
|
run: |
|
|
|
|
mkdir dbs
|
|
|
|
cd repos/${REF}
|
|
|
|
SHORTNAME=${SLUG//[^a-zA-Z0-9_]/}
|
|
|
|
codeql database create --language=java ../../dbs/${SHORTNAME}
|
|
|
|
- name: Regenerate models in-place
|
|
|
|
env:
|
|
|
|
SLUG: ${{ matrix.slug }}
|
|
|
|
run: |
|
|
|
|
SHORTNAME=${SLUG//[^a-zA-Z0-9_]/}
|
2022-12-20 15:39:36 +03:00
|
|
|
java/ql/src/utils/modelgenerator/RegenerateModels.py "${SLUG}" dbs/${SHORTNAME}
|
2022-01-26 17:31:32 +03:00
|
|
|
- name: Stage changes
|
|
|
|
run: |
|
2022-12-05 12:39:17 +03:00
|
|
|
find java -name "*.model.yml" -print0 | xargs -0 git add
|
2022-01-26 17:31:32 +03:00
|
|
|
git status
|
|
|
|
git diff --cached > models.patch
|
2022-04-27 16:17:28 +03:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-01-26 17:31:32 +03:00
|
|
|
with:
|
|
|
|
name: patch
|
|
|
|
path: models.patch
|
|
|
|
retention-days: 7
|