|
| 1 | +name: check |
| 2 | + |
| 3 | +on: [push, pull_request, workflow_dispatch] |
| 4 | + |
| 5 | +jobs: |
| 6 | + check: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + item: |
| 11 | + - {name: code_qualify} |
| 12 | + - {name: defined_word} |
| 13 | + - {name: display_error} |
| 14 | + - {name: meta_header} |
| 15 | + - {name: ngword} |
| 16 | + - {name: inner_link, script: link_check.py --check-inner-link} |
| 17 | + name: check (${{ matrix.item.name }}) |
| 18 | + steps: |
| 19 | + - name: Set up Python |
| 20 | + uses: actions/setup-python@v5 |
| 21 | + with: |
| 22 | + python-version: '3.x' |
| 23 | + - name: Install dependencies |
| 24 | + run: | |
| 25 | + python -m pip install --upgrade pip |
| 26 | + pip install requests |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - name: check |
| 29 | + run: python3 .github/workflows/script/${{ matrix.item.script || format('{0}_check.py', matrix.item.name) }} |
| 30 | + |
| 31 | + detect_forbidden_characters: |
| 32 | + # 本リポジトリでは、以下に挙げる文字の使用を禁止している: |
| 33 | + # U+00AD SOFT HYPHEN (ソフトハイフン) |
| 34 | + # U+200B ZERO WIDTH SPACE (ゼロ幅スペース) |
| 35 | + # |
| 36 | + # 経緯は以下を参照: |
| 37 | + # #735 SOFT HYPHENを削除する? |
| 38 | + # https://github.com/cpprefjp/site/issues/735 |
| 39 | + runs-on: ubuntu-latest |
| 40 | + env: |
| 41 | + RIPGREP_VERSION: 14.1.0 |
| 42 | + BIN_DIR: ${{ github.workspace }}/bin |
| 43 | + REPO_DIR: repo |
| 44 | + cache-version: v1 |
| 45 | + steps: |
| 46 | + - id: cache-ripgrep |
| 47 | + uses: actions/cache@v3 |
| 48 | + with: |
| 49 | + path: ${{ env.BIN_DIR }} |
| 50 | + key: ${{ env.cache-version }}-ripgrep-${{ env.RIPGREP_VERSION }} |
| 51 | + - name: install ripgrep |
| 52 | + if: steps.cache-ripgrep.outputs.cache-hit != 'true' |
| 53 | + run: | |
| 54 | + curl -fsSLO https://github.com/BurntSushi/ripgrep/releases/download/$RIPGREP_VERSION/ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz |
| 55 | + mkdir -p $BIN_DIR |
| 56 | + tar xvf ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz --strip=1 --no-anchor -C $BIN_DIR rg |
| 57 | + working-directory: ${{ runner.temp }} |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + path: ${{ env.REPO_DIR }} |
| 61 | + - name: check |
| 62 | + run: "! $BIN_DIR/rg -t md --vimgrep '[\u00ad\u200b]' $REPO_DIR" |
0 commit comments