2021-08-13 01:45:50 +08:00
|
|
|
name: CI - File health
|
2020-10-26 16:31:25 +00:00
|
|
|
|
2021-02-04 16:15:31 +08:00
|
|
|
on: [pull_request, push]
|
2020-10-26 16:31:25 +00:00
|
|
|
|
2023-02-16 16:16:54 +08:00
|
|
|
permissions: {}
|
|
|
|
|
2022-02-25 13:34:28 +08:00
|
|
|
concurrency:
|
2022-03-02 13:26:13 +08:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-02-25 13:34:28 +08:00
|
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
|
2020-10-26 16:31:25 +00:00
|
|
|
jobs:
|
2021-08-19 11:21:34 +08:00
|
|
|
ci:
|
|
|
|
name: Check
|
2021-08-13 01:55:43 +08:00
|
|
|
runs-on: ubuntu-latest
|
2020-10-26 16:31:25 +00:00
|
|
|
steps:
|
2021-08-14 14:54:15 +08:00
|
|
|
- name: Checkout repository
|
2023-09-05 19:42:07 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-10-26 16:31:25 +00:00
|
|
|
|
2021-08-14 14:56:37 +08:00
|
|
|
- name: Install tools
|
2024-01-02 16:23:09 +08:00
|
|
|
uses: actions/setup-python@v5
|
2022-08-19 12:59:13 +08:00
|
|
|
with:
|
|
|
|
python-version: "*"
|
2020-10-26 16:31:25 +00:00
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
- name: Check files
|
2024-03-03 13:33:07 +08:00
|
|
|
uses: pre-commit/action@v3.0.1
|
2023-09-05 19:37:38 +08:00
|
|
|
|
|
|
|
- name: Check doc
|
|
|
|
env:
|
|
|
|
pandoc_path: "${{ github.workspace }}/../pandoc"
|
|
|
|
run: |
|
|
|
|
# install pandoc
|
|
|
|
curl \
|
|
|
|
-L \
|
|
|
|
-o "${{ runner.temp }}/pandoc.tar.gz" \
|
2024-10-06 09:41:38 +01:00
|
|
|
"https://github.com/jgm/pandoc/releases/download/3.4/pandoc-3.4-linux-amd64.tar.gz"
|
2023-09-05 19:37:38 +08:00
|
|
|
tar -xf "${{ runner.temp }}/pandoc.tar.gz" -C "${{ github.workspace }}/.."
|
|
|
|
mv "${{ github.workspace }}/.."/pandoc-* "${{ env.pandoc_path }}"
|
|
|
|
# run pandoc
|
|
|
|
for lang in doc/*/; do
|
|
|
|
"${{ env.pandoc_path }}/bin/pandoc" -f markdown -t man -s "$lang/qbittorrent.1.md" -o "$lang/qbittorrent.1"
|
|
|
|
"${{ env.pandoc_path }}/bin/pandoc" -f markdown -t man -s "$lang/qbittorrent-nox.1.md" -o "$lang/qbittorrent-nox.1"
|
|
|
|
done
|
|
|
|
# check diff, ignore "Automatically generated by ..." part
|
|
|
|
git diff -I '\.\\".*' --exit-code
|