-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.99 KB
/
check-encoding-v3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: check encoding
on:
workflow_call:
inputs:
federation_repos:
type: string
default: ""
c2a_dir:
type: string
default: '.'
c2a_core:
type: boolean
default: false
secrets:
GH_FEDERATION_ENDPOINT:
required: false
env:
# config file path from src/src_core/Script/CI
CORE_CONFIG_FILE: check_encoding.json
USER_CONFIG_FILE: ../../../src_user/Script/CI/check_encoding.json
jobs:
check_encoding:
runs-on: ubuntu-22.04
steps:
- name: gh-federation
if: inputs.federation_repos != ''
uses: arkedge/gh-federation@7fcfbfdb79bad94f98041c1fb9c317b9ae198011 # v4.0.1
with:
endpoint: ${{ secrets.GH_FEDERATION_ENDPOINT }}
repos: ${{ inputs.federation_repos }}
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: 'recursive'
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version-file: .github/workflows/.python-version
architecture: 'x64'
- run: pip install chardet
- name: check config file
id: config
shell: bash
working-directory: ${{ inputs.c2a_dir }}/src/src_core/Script/CI
run: |
if [ -e "$USER_CONFIG_FILE" ]; then
echo "config_file=${USER_CONFIG_FILE}" >> "$GITHUB_OUTPUT"
else
echo "${USER_CONFIG_FILE} does not exist"
echo "fallback to c2a-core config file"
echo "config_file=${CORE_CONFIG_FILE}" >> "$GITHUB_OUTPUT"
fi
- name: check_encoding for c2a-core
if: inputs.c2a_core
working-directory: ./Script/CI
run: python ./check_encoding.py ./check_encoding.json
- name: check_encoding
if: ${{ ! inputs.c2a_core }}
working-directory: ${{ inputs.c2a_dir }}/src/src_core/Script/CI
run: python ./check_encoding.py ${{ steps.config.outputs.config_file }}