Skip to content

Commit

Permalink
CI: Rework ipt format check
Browse files Browse the repository at this point in the history
We now name that step "IPT checks" as we also do linting. And this means
we should also rename tools/ipt-format.sh.
  • Loading branch information
t-b committed Nov 18, 2024
1 parent 0d3abe3 commit e6fbaca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ concurrency:
jobs:

Ipt:
name: 🔎 IPT Format check
name: 🔎 IPT checks
runs-on: [ self-hosted, Windows ]
steps:
- name: Checkout repository
Expand All @@ -49,8 +49,8 @@ jobs:
run: curl -o ipt.exe "https://byte-physics.de/public-downloads/aistorage/transfer/ipt/0.6.0/ipt.exe"
- name: IPT version
run: ./ipt.exe --version
- name: Format code
run: tools/ipt-format.sh
- name: Format and lint code
run: tools/run-ipt.sh
- name: Check for changed files
run: git diff --name-only --ignore-submodules; git diff --ignore-submodules --quiet
- name: Create patch
Expand Down
9 changes: 8 additions & 1 deletion tools/ipt-format.sh → tools/run-ipt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ then
exit 1
fi

cd $top_level

if [ -n "$CI" ]
then
ipt="./ipt.exe"
Expand All @@ -27,5 +29,10 @@ echo "[format]" > config.toml
while read -r line; do
echo "files = \"$line\"" >> config.toml
done < <(git ls-files ':(attr:ipt)')
$ipt --arg-file config.toml format -i

(cd $top_level && $ipt --arg-file config.toml format -i)
echo "[lint]" >> config.toml
while read -r line; do
echo "files = \"$line\"" >> config.toml
done < <(git ls-files ':(attr:ipt)')
$ipt --arg-file config.toml lint -i

0 comments on commit e6fbaca

Please sign in to comment.