Skip to content

values used to calculate user distribution can contain variables #180

values used to calculate user distribution can contain variables

values used to calculate user distribution can contain variables #180

Workflow file for this run

name: code quality
on:
pull_request:
branches:
- main
jobs:
linting:
name: linting
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
PYTHONPATH: .
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install python dependencies
id: pip
run: python -m pip install .[dev]
- name: pylint
id: pylint
run: python -m pylint --jobs=0 --fail-under=10 grizzly_cli/ tests/
- name: mypy
id: mypy
run: python -m mypy grizzly_cli/ tests/
- name: flake8
id: flake8
run: python -m flake8
test-and-coverage:
name: "test-and-coverage / ${{ matrix.runs-on }} / python-${{ matrix.python-version }}"
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '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-13
env:
PYTHONPATH: .
steps:
- name: timezone
id: timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Stockholm"
timezoneMacos: "Europe/Stockholm"
timezoneWindows: "W. Europe Standard Time"
- name: checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install python dependencies
id: pip
run: python -m pip install .[dev]
- name: pytest (unit)
id: pytest-unit
run: python -m pytest tests/unit
- name: coverage
id: coverage
run: python -m coverage report --fail-under=95
test-e2e:
name: "test-e2e / ${{ matrix.runs-on }} / python-${{ matrix.python-version }}"
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
runs-on: ['ubuntu-latest', 'windows-latest', 'macos-13']
env:
PYTHONPATH: .
steps:
- name: timezone
id: timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Stockholm"
timezoneMacos: "Europe/Stockholm"
timezoneWindows: "W. Europe Standard Time"
- name: checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install python dependencies
id: pip
run: python -m pip install .[dev]
- name: setup docker (macos)
if: ${{ matrix.runs-on == 'macos-13' }}
id: setup-docker-macos
shell: bash
run: |
uname -a
brew install docker docker-compose docker-buildx capstone dtc libslirp libssh ncurses snappy vde qemu lima || true
brew install --ignore-dependencies colima
mkdir -p $HOME/.docker/cli-plugins || true
ln -sfn /usr/local/opt/docker-buildx/bin/docker-buildx ~/.docker/cli-plugins/docker-buildx
ln -sfn /usr/local/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
colima start --verbose || { cat /Users/runner/.colima/_lima/colima/serial*.log; exit 1; }
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: install docker-compose (ubuntu)
id: install-docker-compose
if: ${{ matrix.runs-on == 'ubuntu-latest' }}
uses: KengoTODA/actions-setup-docker-compose@main
with:
version: '2.20.3'
- name: set shell encoding (windows)
if: ${{ matrix.runs-on == 'windows-latest' }}
run: |
if (!(Test-Path $profile))
{
New-Item -Path $profile -Type File -Force
}
# note that PYTHONUTF8=1 only works for python >= 3.7...
'$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding' + [Environment]::Newline + (Get-Content -Raw $profile -ErrorAction SilentlyContinue) + [Environment]::Newline + '$env:PYTHONIOENCODING = "utf-8"' + [Environment]::Newline + '$env:PYTHONUTF8 = 1' + [Environment]::Newline | Set-Content -Encoding utf8 $profile
- name: ssh agent
id: ssh-agent
if: ${{ matrix.runs-on != 'windows-latest' }}
run: |
ssh-agent -a /tmp/ssh_auth_sock
- name: pytest (e2e)
id: pytest-e2e
env:
E2E_RUN_DIST: True
SSH_AUTH_SOCK: /tmp/ssh_auth_sock
run: python -m pytest --no-cov tests/e2e
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
with:
fetch-depth: 0
- name: setup python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install python dependencies
id: pip
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:
- linting
- test-and-coverage
- test-e2e
- documentation-scripts
steps:
- uses: technote-space/workflow-conclusion-action@v3
- run: |
[[ "${{ env.WORKFLOW_CONCLUSION }}" == "success" ]] || exit 1