Skip to content

Commit c17445b

Browse files
shenxianpeng2bndy5
andauthored
Create python venv for macOS (#113)
* Create python venv for macOS * fix package install and pre-commit * Update action.yml Co-authored-by: Brendan <[email protected]> * relocate venv * Update action.yml Co-authored-by: Brendan <[email protected]> * Update action.yml Co-authored-by: Brendan <[email protected]> Co-authored-by: Brendan <[email protected]>
1 parent ec1e737 commit c17445b

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,20 @@ runs:
8787
steps:
8888
- name: Install action dependencies
8989
shell: bash
90-
run: python3 -m pip install clang-tools==0.6.2 cpp-linter==1.4.8
91-
- name: Install clang-tools binary executables
92-
shell: bash
93-
run: clang-tools -i ${{ inputs.version }} -b
90+
run: |
91+
if [[ "${{runner.os}}" == "macOS" ]];then
92+
python3 -m venv '${{ github.action_path }}/venv'
93+
source '${{ github.action_path }}/venv/bin/activate'
94+
fi
95+
python3 -m pip install -r '${{ github.action_path }}/requirements.txt'
96+
clang-tools -i ${{ inputs.version }} -b
9497
- name: Run cpp-linter
9598
id: cpp-linter
9699
shell: bash
97100
run: |
101+
if [[ "${{runner.os}}" == "macOS" ]];then
102+
source '${{ github.action_path }}/venv/bin/activate'
103+
fi
98104
cpp-linter \
99105
--style="${{ inputs.style }}" \
100106
--extensions=${{ inputs.extensions }} \

requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Install clang-tools binaries (clang-format, clang-tidy)
2+
# For details please see: https://github.com/cpp-linter/clang-tools-pip
3+
clang-tools==0.6.2
4+
5+
# cpp-linter core Python executable package
6+
# For details please see: https://github.com/cpp-linter/cpp-linter
7+
cpp-linter==1.4.8

0 commit comments

Comments
 (0)