Skip to content

Commit 08ab31c

Browse files
authored
Merge pull request #710 from sir-gon/develop
[CONFIG] [Github Actions] lint and test actions splitted
2 parents 0cdbd9a + 0ecc214 commit 08ab31c

File tree

4 files changed

+84
-24
lines changed

4 files changed

+84
-24
lines changed

.github/workflows/prettier-json.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Prettier JSON Lint
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches: ['main']
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: ['main']
10+
workflow_dispatch:
11+
12+
jobs:
13+
json-lint:
14+
name: 'Prettier JSON Lint'
15+
runs-on: ['ubuntu-24.04']
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 24.x
23+
24+
- name: Install Prettier
25+
run: |
26+
npm install -g [email protected]
27+
28+
- name: Prettier LINT / Style JSON
29+
run: >
30+
prettier --check ./src/**/*.json

.github/workflows/python.yml renamed to .github/workflows/python-lint.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Python CI Tests
2+
name: Python CI Lint
33

44
on: # yamllint disable-line rule:truthy
55
push:
@@ -9,12 +9,9 @@ on: # yamllint disable-line rule:truthy
99
branches: ['main']
1010
workflow_dispatch:
1111

12-
env:
13-
LOG_LEVEL: INFO
14-
1512
jobs:
16-
build:
17-
name: 'Run CI'
13+
lint:
14+
name: 'Python CI Lint'
1815
strategy:
1916
fail-fast: false
2017
matrix:
@@ -52,13 +49,3 @@ jobs:
5249
- name: Styling (autopep8)
5350
run: |
5451
python3 -m autopep8 --diff --recursive --exit-code --verbose .
55-
- name: Test
56-
run: >
57-
coverage run -m pytest --verbose
58-
-o log_cli=true
59-
--log-cli-level=INFO
60-
src/
61-
62-
- name: Coverage
63-
run: |
64-
coverage report

.github/workflows/python-test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Python CI Test
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches: ['main']
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: ['main']
10+
workflow_dispatch:
11+
12+
env:
13+
LOG_LEVEL: INFO
14+
15+
jobs:
16+
test:
17+
name: 'Python CI Test'
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: ['ubuntu-24.04', 'macos-14', 'windows-2022']
22+
python: ['3.10', '3.11', '3.12']
23+
runs-on: ${{ matrix.os }}
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
26+
27+
- name: Setup Python
28+
uses: actions/setup-python@master
29+
with:
30+
python-version: ${{ matrix.python }}
31+
32+
- name: Install
33+
run: |
34+
pip3 install -r requirements.txt
35+
36+
- name: Test
37+
run: >
38+
coverage run -m pytest --verbose
39+
-o log_cli=true
40+
--log-cli-level=INFO
41+
src/
42+
43+
- name: Coverage
44+
run: |
45+
coverage report

Makefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,28 +67,26 @@ dependencies:
6767
${PACKAGE_TOOL} install -r requirements.txt
6868
@echo "################################################################################"
6969

70+
lint/json:
71+
prettier --check ./src/**/*.json
72+
7073
lint/markdown:
7174
markdownlint '**/*.md' --ignore node_modules && echo '✔ Your code looks good.'
75+
7276
lint/yaml:
7377
yamllint --stric . && echo '✔ Your code looks good.'
7478

75-
lint: lint/markdown lint/yaml test/styling test/static
79+
lint: lint/markdown lint/yaml lint/json test/styling test/static
7680

7781
test/static: dependencies
7882
${RUNTIME_TOOL} -m pylint --verbose --recursive yes src/
7983
${RUNTIME_TOOL} -m flake8 --verbose src/
8084
${RUNTIME_TOOL} -m pyright --verbose src/
8185

82-
83-
test/styling/json: dependencies
84-
prettier --check ./src/**/*.json
85-
86-
test/styling/sources: dependencies
86+
test/styling: dependencies
8787
${RUNTIME_TOOL} -m pycodestyle --statistics src/
8888
${RUNTIME_TOOL} -m autopep8 --diff --recursive --exit-code --verbose .
8989

90-
test/styling: dependencies test/styling/sources test/styling/json
91-
9290
format/json:
9391
prettier --write ./src/**/*.json
9492

0 commit comments

Comments
 (0)