Create 嘻嘻.cpp #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check file encoding | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get checker hash | |
id: computehash | |
uses: seepine/hash-files@v1 | |
with: | |
# The working dir for the action. | |
# Default: ${{ github.workspace }} | |
# workdir: '' | |
# The patterns used to match files. | |
patterns: '.github/workflows/encodingcheck/**' | |
- name: Cache | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: .github/workflows/encodingcheck/build/encodingcheck | |
key: check-build-cache-${{ steps.computehash.outputs.hash }} | |
- name: Build | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
cd .github/workflows/encodingcheck | |
mkdir build && cd build | |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13 -DBUILD_ENCODINGCHECK=true .. | |
cmake --build . -t encodingcheck -j | |
- name: Check | |
run: .github/workflows/encodingcheck/build/encodingcheck |