Skip to content

Commit e36b4c9

Browse files
authored
Add default version (without compilation) (#5)
* Add version without compilation * Fix action.yml
1 parent 6b6f557 commit e36b4c9

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

action.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ inputs:
2929
Additional argument to prepend to the compiler command line.
3030
required: false
3131
default: ""
32+
install-stable:
33+
description: |
34+
The stable version is being downloaded without compilation.
35+
In this case, the version field is ignored.
36+
required: false
37+
default: false
3238
ignore-headers:
3339
description: |
3440
Ignore thirdparty headers.
@@ -85,7 +91,7 @@ runs:
8591
id: cache-clazy-standalone
8692
with:
8793
path: ~/.local/clazy/
88-
key: ${{ runner.os }}-clazy-${{ inputs.version }}
94+
key: ${{ runner.os }}-clazy-${{ inputs.version }}-${{ github.event.pull_request.number }}
8995

9096
- name: Install dependencies
9197
shell: bash
@@ -95,9 +101,16 @@ runs:
95101
libclang-dev \
96102
llvm-dev
97103
104+
- name: Install clazy
105+
if: ${{ inputs.install-stable }} == 'true'
106+
shell: bash
107+
run: |
108+
sudo apt-get update
109+
sudo apt-get install clazy
110+
98111
- name: Build clazy
99112
shell: bash
100-
if: steps.cache-clazy-standalone.outputs.cache-hit != 'true'
113+
if: ${{ steps.cache-clazy-standalone.outputs.cache-hit != 'true' && inputs.install-stable != 'true' }}
101114
run: |
102115
sudo apt-get update
103116
sudo apt-get install -y --no-install-recommends \
@@ -111,11 +124,11 @@ runs:
111124
&& cmake --build . --target install && cd .. && rm -rf ./clazy-${{ inputs.version }}
112125
113126
- name: Save clazy
114-
if: steps.cache-clazy-standalone.outputs.cache-hit != 'true'
127+
if: ${{ steps.cache-clazy-standalone.outputs.cache-hit != 'true' && inputs.install-stable != 'true' }}
115128
uses: actions/cache@v4
116129
with:
117130
path: ~/.local/clazy
118-
key: ${{ runner.os }}-clazy-${{ inputs.version }}
131+
key: ${{ runner.os }}-clazy-${{ inputs.version }}-${{ github.event.pull_request.number }}
119132

120133
- name: Start clazy
121134
id: clazy-check

0 commit comments

Comments
 (0)