ci: cache ktlint binary in GitHub Actions workflows
This commit is contained in:
1 parent
1b188b6b31
commit
67c633396e
2 files changed
+26
-2
No files matched your search
@@ -45,11 +45,23 @@ jobs:
|
||||
- name: Grant Execute Permission for Gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Cache ktlint
|
||||
id: cache-ktlint
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.local/bin/ktlint
|
||||
key: ktlint-1.2.1
|
||||
|
||||
- name: Install ktlint
|
||||
if: steps.cache-ktlint.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p ~/.local/bin
|
||||
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.2.1/ktlint
|
||||
chmod +x ktlint
|
||||
sudo mv ktlint /usr/local/bin/
|
||||
mv ktlint ~/.local/bin/
|
||||
|
||||
- name: Add local bin to PATH
|
||||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Run ktlintCheck
|
||||
run: ./gradlew ktlintCheck
|
||||
|
||||
Reference in new issue
Block a user