Skip to content

Commit 55d8843

Browse files
authored
cpplint.yml: Update GitHub Actions (#7)
* Update cpplint.yml * Remove outdated Python setup * Update cpplint.yml * Update cpplint.yml * Update cpplint_modified_files.yml * Update cpplint_modified_files.yml
1 parent 178266b commit 55d8843

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/cpplint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ jobs:
77
cpplint:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-python@v2
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-python@v4
12+
with:
13+
python-version: 3.x
1214
- run: pip install cpplint
1315
- run: cpplint --recursive .

.github/workflows/cpplint_modified_files.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ jobs:
1111
cpplint_modified_files:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-python@v2
16-
- shell: python # Show the version of shell: python and then upgrade shell: python to Python 3.8
17-
run: import sys ; print("Python {}.{}.{}".format(*sys.version_info)) # Legacy Python :-(
18-
- run: sudo update-alternatives --install /usr/bin/python python ${pythonLocation}/bin/python3.8 10
14+
- uses: actions/checkout@v1 # v1, NOT v2 or v3
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: 3.x
18+
- shell: python # Print the version of Python
19+
run: import sys ; print("Python {}.{}.{}".format(*sys.version_info))
1920
- run: python -m pip install cpplint
2021
- run: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
2122
- run: git diff origin/master --name-only > git_diff.txt
@@ -26,7 +27,7 @@ jobs:
2627
import subprocess
2728
import sys
2829
29-
print("Python {}.{}.{}".format(*sys.version_info)) # Python 3.8
30+
print("Python {}.{}.{}".format(*sys.version_info)) # Currently Python 3.11.2
3031
with open("git_diff.txt") as in_file:
3132
modified_files = sorted(in_file.read().splitlines())
3233
print("{} files were modified.".format(len(modified_files)))

0 commit comments

Comments
 (0)