diff --git a/.github/workflows/prettier-json.yml b/.github/workflows/prettier-json.yml new file mode 100644 index 0000000..c1b1e12 --- /dev/null +++ b/.github/workflows/prettier-json.yml @@ -0,0 +1,30 @@ +--- +name: Prettier JSON Lint + +on: # yamllint disable-line rule:truthy + push: + branches: ['main'] + pull_request: + # The branches below must be a subset of the branches above + branches: ['main'] + workflow_dispatch: + +jobs: + json-lint: + name: 'Prettier JSON Lint' + runs-on: ['ubuntu-24.04'] + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 24.x + + - name: Install Prettier + run: | + npm install -g prettier@3.5.3 + + - name: Prettier LINT / Style JSON + run: > + prettier --check ./src/**/*.json diff --git a/.github/workflows/python.yml b/.github/workflows/python-lint.yml similarity index 80% rename from .github/workflows/python.yml rename to .github/workflows/python-lint.yml index 23787a9..a941d8f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python-lint.yml @@ -1,5 +1,5 @@ --- -name: Python CI Tests +name: Python CI Lint on: # yamllint disable-line rule:truthy push: @@ -9,12 +9,9 @@ on: # yamllint disable-line rule:truthy branches: ['main'] workflow_dispatch: -env: - LOG_LEVEL: INFO - jobs: - build: - name: 'Run CI' + lint: + name: 'Python CI Lint' strategy: fail-fast: false matrix: @@ -52,13 +49,3 @@ jobs: - name: Styling (autopep8) run: | python3 -m autopep8 --diff --recursive --exit-code --verbose . - - name: Test - run: > - coverage run -m pytest --verbose - -o log_cli=true - --log-cli-level=INFO - src/ - - - name: Coverage - run: | - coverage report diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml new file mode 100644 index 0000000..6454e78 --- /dev/null +++ b/.github/workflows/python-test.yml @@ -0,0 +1,45 @@ +--- +name: Python CI Test + +on: # yamllint disable-line rule:truthy + push: + branches: ['main'] + pull_request: + # The branches below must be a subset of the branches above + branches: ['main'] + workflow_dispatch: + +env: + LOG_LEVEL: INFO + +jobs: + test: + name: 'Python CI Test' + strategy: + fail-fast: false + matrix: + os: ['ubuntu-24.04', 'macos-14', 'windows-2022'] + python: ['3.10', '3.11', '3.12'] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Setup Python + uses: actions/setup-python@master + with: + python-version: ${{ matrix.python }} + + - name: Install + run: | + pip3 install -r requirements.txt + + - name: Test + run: > + coverage run -m pytest --verbose + -o log_cli=true + --log-cli-level=INFO + src/ + + - name: Coverage + run: | + coverage report diff --git a/Makefile b/Makefile index 6dce965..b26bb94 100644 --- a/Makefile +++ b/Makefile @@ -67,28 +67,26 @@ dependencies: ${PACKAGE_TOOL} install -r requirements.txt @echo "################################################################################" +lint/json: + prettier --check ./src/**/*.json + lint/markdown: markdownlint '**/*.md' --ignore node_modules && echo '✔ Your code looks good.' + lint/yaml: yamllint --stric . && echo '✔ Your code looks good.' -lint: lint/markdown lint/yaml test/styling test/static +lint: lint/markdown lint/yaml lint/json test/styling test/static test/static: dependencies ${RUNTIME_TOOL} -m pylint --verbose --recursive yes src/ ${RUNTIME_TOOL} -m flake8 --verbose src/ ${RUNTIME_TOOL} -m pyright --verbose src/ - -test/styling/json: dependencies - prettier --check ./src/**/*.json - -test/styling/sources: dependencies +test/styling: dependencies ${RUNTIME_TOOL} -m pycodestyle --statistics src/ ${RUNTIME_TOOL} -m autopep8 --diff --recursive --exit-code --verbose . -test/styling: dependencies test/styling/sources test/styling/json - format/json: prettier --write ./src/**/*.json