Add CI check that T4 generated code is fresh (#575)

This commit is contained in:
Atif Aziz 2021-10-19 15:22:39 +02:00 коммит произвёл GitHub
Родитель 3db21d096d
Коммит af5a437a03
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 28 добавлений и 0 удалений

12
.config/dotnet-tools.json Normal file
Просмотреть файл

@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-t4": {
"version": "2.2.1",
"commands": [
"t4"
]
}
}
}

16
.github/workflows/ci.yaml поставляемый
Просмотреть файл

@ -73,6 +73,22 @@ jobs:
- name: .NET SDK Information
run: dotnet --info
- name: Restore Tools
run: dotnet tool restore
- name: Refresh T4 Generated Code
# Re-run all T4 templates to refresh them.
run: git ls-files *.tt | xargs -t -n 1 dotnet t4
- name: Check for Modifications
# "git diff" with "--exit-code" makes the program exit with codes similar to diff.
# That is, it exits with 1 if there were differences and 0 means no differences.
# This is to ensure that the last step did not introduce any changes to the working
# tree, which would mean that the tracked generated code is not up to date with the
# template. The templates should be executed on a local clone (either using VS or
# via "dotnet t4") and the (refreshed) generated code committed.
run: git diff --exit-code
# build LoRa Engine
- name: Build LoRa Engine
run: dotnet build --configuration ${{ env.buildConfiguration }}