summaryrefslogtreecommitdiff
path: root/.circleci/config.yml
blob: 67d8ab0e0a6e6c9b014402c6963b37c36d323b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# To run the tests, CircleCI needs these environment variables:
# QT_EMAIL - email address for a Qt account
# QT_PASSWORD - password for a Qt account
# (Unfortunately you can't install Qt without logging in.)

version: 2
workflows:
  version: 2
  test:
    jobs:
      - test-3.6
      - test-3.7
      - test-3.8

jobs:
  test-3.6: &test-template
    docker:
      - image: circleci/python:3.6-buster

    working_directory: ~/repo

    steps:
      - checkout

      - run:
          name: Install Qt5 binaries
          command: |
            sudo apt-get update
            sudo apt-get install xvfb libdbus-1-3 libxkbcommon-x11-0 libxkbcommon-x11-dev
            cd ~/
            wget https://download.qt.io/official_releases/qt/5.14/5.14.0/qt-opensource-linux-x64-5.14.0.run
            chmod +x qt-opensource-linux-x64-5.14.0.run
            xvfb-run ./qt-opensource-linux-x64-5.14.0.run --script ~/repo/.circleci/qt-installer-script.js --platform minimal --verbose

      - run:
          name: Install dependencies
          command: |
            sudo apt-get update
            sudo apt-get install -y python3-pip xvfb tor obfs4proxy
            sudo pip3 install poetry flake8
            poetry install

      - run:
          name: Run flake tests
          command: |
            # stop the build if there are Python syntax errors or undefined names
            flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
            # exit-zero treats all errors as warnings.  The GitHub editor is 127 chars wide
            flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

      - run:
          name: Run unit tests
          command: |
            xvfb-run -s "-screen 0 1280x1024x24" poetry run ./tests/run.sh --rungui

  test-3.7:
    <<: *test-template
    docker:
      - image: circleci/python:3.7-buster

  test-3.8:
    <<: *test-template
    docker:
      - image: circleci/python:3.8-buster