Skip to content

support grizzly-cli#94 #135

support grizzly-cli#94

support grizzly-cli#94 #135

Workflow file for this run

name: code quality
on:
pull_request:
branches:
- main
jobs:
server:
name: server
runs-on: ${{ matrix.runs-on }}
defaults:
run:
working-directory: ./grizzly-ls
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
runs-on: ['ubuntu-latest']
include:
- python-version: '3.12'
runs-on: windows-latest
- python-version: '3.12'
runs-on: macos-latest
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
- name: setup python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
id: pip
working-directory: ./
run: |
bash ./script/install.sh server
- name: pytest (unit+e2e)
id: pytest
run: python -m pytest
- name: coverage
id: coverage
run: python -m coverage report
client-vscode:
name: 'client/vscode (${{ matrix.runs-on }})'
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: ['ubuntu-latest', 'windows-latest', 'macos-latest']
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
- name: setup python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: 'client/vscode/package-lock.json'
- name: install dependencies
id: install
run: |
bash ./script/install.sh client/vscode
bash ./script/install.sh server +e
npm install -g @vscode/vsce
- name: test
id: test
uses: hankolsen/xvfb-action@dcb076c1c3802845f73bb6fe14a009d8d3377255
env:
VERBOSE: true
VIRTUAL_ENV: ${{env.pythonLocation}}
with:
run: |
npm test
working-directory: './client/vscode'
- name: server logs
id: server-logs
if: always()
continue-on-error: true
run: |
cat tests/project/grizzly-ls.log
- name: test package
id: test-package
working-directory: './client/vscode'
run: |
vsce package
linting:
name: linting
runs-on: ubuntu-latest
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
- name: setup python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: './client/vscode/package-lock.json'
- name: install dependencies
id: install
run: |
bash ./script/install.sh
- name: 'server: pylint'
id: server-pylint
if: always()
working-directory: ./grizzly-ls
run: python3 -m pylint --jobs=0 --fail-under=10 src/ tests/
- name: 'server: mypy'
id: server-mypy
if: always()
working-directory: ./grizzly-ls
run: python3 -m mypy --config-file=pyproject.toml src/ tests/
- name: 'server: flake8'
id: server-flake8
if: always()
working-directory: ./grizzly-ls
run: python3 -m flake8
- name: 'server: black'
id: server-black
if: always()
working-directory: ./grizzly-ls
run: python3 -m black --check .
- name: 'client: eslint'
id: client-eslint
if: always()
working-directory: ./client/vscode
run: npm run lint
documentation-scripts:
name: 'documentation / ${{ matrix.script }}'
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
script:
- script/docs-generate-licenses.py
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
- name: setup python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install python dependencies
id: pip
working-directory: ./grizzly-ls
run: python -m pip install --upgrade .[dev]
- name: exists
run: test -e ${{ matrix.script }}
- name: executable
run: test -x ${{ matrix.script }}
- name: runnable
run: ./${{ matrix.script }} 1> /dev/null
releaseable:
name: releasable
runs-on: 'ubuntu-latest'
if: always()
needs:
- server
- client-vscode
- linting
- documentation-scripts
steps:
- uses: technote-space/workflow-conclusion-action@v3
- name: is releaseable?
run: |
[[ "${{ env.WORKFLOW_CONCLUSION }}" == "success" ]] || exit 1