diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..a48537f5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,73 @@ +name: Quick Test + +on: push + +jobs: + default: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-18.04, ubuntu-latest, macos-latest] + python-version: [2.7, 3.8] + include: + - os: ubuntu-18.04 + python-version: 3.9 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Set environment variables + run: | + if [[ ${{ runner.os }} == macOS ]]; then + echo "LDFLAGS=-L/usr/local/opt/openssl@1.1/lib" >> $GITHUB_ENV + echo "CPPFLAGS=-I/usr/local/opt/openssl@1.1/include" >> $GITHUB_ENV + fi + - name: Install apt dependencies + if: ${{ runner.os == 'Linux' }} + run: | + sudo apt-get update -q + install="sudo apt-get install + -yq --no-install-suggests --no-install-recommends" + $install build-essential libcap-dev libssl-dev python-all-dev tor + if [[ ! ${{ matrix.python-version }} == 2.7 ]]; then + $install qtbase5-dev qt5-default + fi + - name: Install brew dependencies + if: ${{ runner.os == 'macOS' && matrix.python-version == '2.7' }} + run: | + brew install tor + brew services start tor + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip install wheel + pip install -r requirements.txt + - name: Portable run + if: ${{ matrix.os == 'ubuntu-18.04' && matrix.python-version == '2.7' }} + run: | + python -m pybitmessage.bitmessagemain -t + - name: Install + run: | + python setup.py install + - name: Install additional python dependencies + if: ${{ matrix.python-version == '3.8' }} + run: | + pip install bandit flake8 + - name: Lint + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }} + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 pybitmessage --count --select=E9,F63,F7,F82 \ + --show-source --statistics --exit-zero + bandit -r --exit-zero -x tests,bitmessagecurses -s B608 pybitmessage + - name: Test + run: | + export PYTHONWARNINGS=all + python checkdeps.py + python src/bitmessagemain.py -t + python -bm tests diff --git a/setup.cfg b/setup.cfg index a4e0547c..77c8bae6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,7 @@ max-line-length = 119 [flake8] +exclude = bitmessagecurses,network,umsgpack,bitmessagecli.py max-line-length = 119 ignore = E722,F841,W503 # E722: pylint is preferred for bare-except