Skip to content

Commit 937a21f

Browse files
committed
Merge branch 'main' into dev
2 parents d10d016 + a3054e2 commit 937a21f

File tree

5 files changed

+65
-287
lines changed

5 files changed

+65
-287
lines changed

.github/logToCs.py

-246
This file was deleted.

.github/workflows/pre-commit.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@ jobs:
77
pre-commit:
88
runs-on: ubuntu-latest
99
env:
10-
LOG_TO_CS: .github/logToCs.py
1110
RAW_LOG: pre-commit.log
1211
CS_XML: pre-commit.xml
1312
steps:
1413
- run: sudo apt-get update && sudo apt-get install cppcheck
1514
if: false
1615
- uses: actions/checkout@v4
17-
- uses: actions/setup-python@v4
16+
- uses: actions/setup-python@v5
1817
if: false
1918
with:
2019
cache: pip
21-
python-version: "3.12.1"
20+
python-version: 3.12.1
2221
- run: python -m pip install pre-commit
23-
- uses: actions/cache/restore@v3
22+
- uses: actions/cache/restore@v4
2423
with:
2524
path: ~/.cache/pre-commit/
26-
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml')
27-
}}
25+
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
2826
- name: Run pre-commit hooks
29-
env:
30-
SKIP: no-commit-to-branch
3127
run: |
3228
set -o pipefail
29+
pre-commit gc
3330
pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}
34-
- name: Convert Raw Log to CheckStyle format
35-
if: ${{ failure() }}
36-
run: |
37-
${LOG_TO_CS} ${RAW_LOG} ${CS_XML}
38-
- name: Annotate Source Code with Messages
39-
uses: staabm/annotate-pull-request-from-checkstyle-action@v1
31+
- name: Convert Raw Log to Checkstyle format (launch action)
32+
uses: mdeweerd/[email protected]
4033
if: ${{ failure() }}
4134
with:
42-
files: ${{ env.CS_XML }}
43-
notices-as-warnings: true # optional
44-
prepend-filename: true # optional
45-
- uses: actions/cache/save@v3
46-
if: ${{ always() }}
35+
in: ${{ env.RAW_LOG }}
36+
# out: ${{ env.CS_XML }}
37+
- uses: actions/cache/save@v4
38+
if: ${{ ! cancelled() }}
4739
with:
4840
path: ~/.cache/pre-commit/
49-
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml')
50-
}}
41+
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
42+
- name: Provide log as artifact
43+
uses: actions/upload-artifact@v4
44+
if: ${{ ! cancelled() }}
45+
with:
46+
name: precommit-logs
47+
path: |
48+
${{ env.RAW_LOG }}
49+
${{ env.CS_XML }}
50+
retention-days: 2

.github/workflows/stats.yaml

+33-17
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,46 @@ jobs:
99
# Credit: https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions
1010
- name: Extract branch name
1111
#run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
12-
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/}) >> $GITHUB_OUTPUT"
12+
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
1313
id: extract_branch
1414
- uses: actions/checkout@v4
1515
with:
1616
ref: ${{ steps.extract_branch.outputs.branch }}
1717
- run: ${{ github.workspace }}/.github/scripts/gen_stats.sh
18-
- run: |
19-
git status
20-
git branch
18+
- name: Commit changes
19+
run: |-
20+
for r in $(git remote) ; do git remote get-url --all $r ; done
2121
git config user.name github-actions
2222
git config user.email [email protected]
23-
git add .
24-
git commit -m '[Bot] stats - Update STATS.md'
23+
git commit -a -m '[Bot] stats - Update STATS.md'
2524
git push
26-
- name: Commit updated resources
27-
if: false
28-
uses: test-room-7/action-update-file@v1
29-
with:
30-
file-path: STATS.md
31-
commit-msg: '[Bot] stats - Update STATS.md'
32-
github-token: ${{ secrets.GITHUB_TOKEN }}
33-
# - uses: stefanzweifel/git-auto-commit-action@v4
34-
# with:
35-
# commit_message: '[Bot] stats - Update STATS.md'
36-
# commit_user_name: stats
3725
# commit_user_email: stats@nill
3826
# commit_author: STATS BOT <stats>
27+
- uses: dorny/paths-filter@v2
28+
id: changes
29+
with:
30+
filters: |
31+
man:
32+
- 'man.md'
33+
autotools:
34+
- 'aclocal.m4'
35+
- 'configure.ac'
36+
- uses: docker://pandoc/core:2.17
37+
if: ${{ github.event_name == 'workflow_dispath' || steps.changes.outputs.man == 'true' }}
38+
with:
39+
args: -s man.md -t man -o shc.1
40+
- uses: docker://pandoc/core:2.17
41+
if: ${{ github.event_name == 'workflow_dispath' || steps.changes.outputs.man == 'true' }}
42+
with:
43+
args: -s man.md -t html -o man.html
44+
- run: |-
45+
./autogen.sh
46+
if: ${{ github.event_name == 'workflow_dispath' || steps.changes.outputs.autotools == 'true' }}
47+
- name: Commit changes
48+
if: ${{ github.event_name == 'workflow_dispath' || steps.changes.outputs.man == 'true' || steps.changes.outputs.autotools }}
49+
run: |-
50+
for r in $(git remote) ; do git remote get-url --all $r ; done
51+
git config user.name github-actions
52+
git config user.email [email protected]
53+
git commit -a -m "ci: Github Action Generate Files"
54+
git push

0 commit comments

Comments
 (0)